diff --git a/nimble/host/src/ble_gap.c b/nimble/host/src/ble_gap.c index b935eface0..b264efd5c9 100644 --- a/nimble/host/src/ble_gap.c +++ b/nimble/host/src/ble_gap.c @@ -2514,7 +2514,17 @@ ble_gap_adv_stop_no_lock(void) int ble_gap_adv_stop(void) { -#if NIMBLE_BLE_ADVERTISE && !MYNEWT_VAL(BLE_EXT_ADV) +#if NIMBLE_BLE_ADVERTISE +#if MYNEWT_VAL(BLE_EXT_ADV) + int rc; + + rc = ble_gap_ext_adv_stop(MYNEWT_VAL(BLE_HS_EXT_ADV_LEGACY_INSTANCE)); + if (rc) { + return rc; + } + + return ble_gap_ext_adv_remove(MYNEWT_VAL(BLE_HS_EXT_ADV_LEGACY_INSTANCE)); +#else int rc; if (!ble_hs_is_enabled()) { @@ -2526,6 +2536,7 @@ ble_gap_adv_stop(void) ble_hs_unlock(); return rc; +#endif #else return BLE_HS_ENOTSUP; #endif @@ -2712,7 +2723,73 @@ ble_gap_adv_start(uint8_t own_addr_type, const ble_addr_t *direct_addr, const struct ble_gap_adv_params *adv_params, ble_gap_event_fn *cb, void *cb_arg) { -#if NIMBLE_BLE_ADVERTISE && !MYNEWT_VAL(BLE_EXT_ADV) +#if NIMBLE_BLE_ADVERTISE +#if MYNEWT_VAL(BLE_EXT_ADV) + struct ble_gap_ext_adv_params ext_params; + int duration; + int rc; + + STATS_INC(ble_gap_stats, adv_start); + + if (!ble_hs_is_enabled()) { + return BLE_HS_EDISABLED; + } + + memset(&ext_params, 0, sizeof(ext_params)); + + ext_params.own_addr_type = own_addr_type; + ext_params.primary_phy = BLE_HCI_LE_PHY_1M; + ext_params.secondary_phy = BLE_HCI_LE_PHY_1M; + ext_params.tx_power = 127; + ext_params.sid = 0; + ext_params.legacy_pdu = 1; + + switch (adv_params->conn_mode) { + case BLE_GAP_CONN_MODE_NON: + if (adv_params->disc_mode != BLE_GAP_DISC_MODE_NON) { + ext_params.scannable = 1; + } + break; + case BLE_GAP_CONN_MODE_DIR: + if (!direct_addr) { + return BLE_HS_EINVAL; + } + + ext_params.peer = *direct_addr; + ext_params.directed = 1; + if (adv_params->high_duty_cycle) { + ext_params.high_duty_directed = 1; + } + break; + case BLE_GAP_CONN_MODE_UND: + ext_params.connectable = 1; + ext_params.scannable = 1; + break; + default: + return BLE_HS_EINVAL; + } + + ext_params.itvl_min = adv_params->itvl_min; + ext_params.itvl_max = adv_params->itvl_max; + ext_params.channel_map = adv_params->channel_map; + ext_params.filter_policy = adv_params->filter_policy; + ext_params.high_duty_directed = adv_params->high_duty_cycle; + + /* configure instance 0 */ + rc = ble_gap_ext_adv_configure(MYNEWT_VAL(BLE_HS_EXT_ADV_LEGACY_INSTANCE), + &ext_params, NULL, cb, cb_arg); + if (rc) { + return rc; + } + + if (duration_ms == BLE_HS_FOREVER) { + duration = 0; + } else { + duration = duration_ms / 10; + } + + return ble_gap_ext_adv_start(MYNEWT_VAL(BLE_HS_EXT_ADV_LEGACY_INSTANCE), duration, 0); +#else uint32_t duration_ticks; int rc; @@ -2788,6 +2865,7 @@ ble_gap_adv_start(uint8_t own_addr_type, const ble_addr_t *direct_addr, STATS_INC(ble_gap_stats, adv_start_fail); } return rc; +#endif #else return BLE_HS_ENOTSUP; #endif @@ -2796,7 +2874,29 @@ ble_gap_adv_start(uint8_t own_addr_type, const ble_addr_t *direct_addr, int ble_gap_adv_set_data(const uint8_t *data, int data_len) { -#if NIMBLE_BLE_ADVERTISE && !MYNEWT_VAL(BLE_EXT_ADV) +#if NIMBLE_BLE_ADVERTISE +#if MYNEWT_VAL(BLE_EXT_ADV) + struct os_mbuf *mbuf; + int rc; + + if (((data == NULL) && (data_len != 0)) || + (data_len > BLE_HCI_MAX_ADV_DATA_LEN)) { + return BLE_HS_EINVAL; + } + + mbuf = os_msys_get_pkthdr(data_len, 0); + if (!mbuf) { + return BLE_HS_ENOMEM; + } + + rc = os_mbuf_append(mbuf, data, data_len); + if (rc) { + os_mbuf_free_chain(mbuf); + return BLE_HS_ENOMEM; + } + + return ble_gap_ext_adv_set_data(MYNEWT_VAL(BLE_HS_EXT_ADV_LEGACY_INSTANCE), mbuf); +#else struct ble_hci_le_set_adv_data_cp cmd; uint16_t opcode; @@ -2818,6 +2918,7 @@ ble_gap_adv_set_data(const uint8_t *data, int data_len) opcode = BLE_HCI_OP(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_SET_ADV_DATA); return ble_hs_hci_cmd_tx(opcode, &cmd, sizeof(cmd), NULL, 0); +#endif #else return BLE_HS_ENOTSUP; #endif @@ -2826,7 +2927,29 @@ ble_gap_adv_set_data(const uint8_t *data, int data_len) int ble_gap_adv_rsp_set_data(const uint8_t *data, int data_len) { -#if NIMBLE_BLE_ADVERTISE && !MYNEWT_VAL(BLE_EXT_ADV) +#if NIMBLE_BLE_ADVERTISE +#if MYNEWT_VAL(BLE_EXT_ADV) + struct os_mbuf *mbuf; + int rc; + + if (((data == NULL) && (data_len != 0)) || + (data_len > BLE_HCI_MAX_ADV_DATA_LEN)) { + return BLE_HS_EINVAL; + } + + mbuf = os_msys_get_pkthdr(data_len, 0); + if (!mbuf) { + return BLE_HS_ENOMEM; + } + + rc = os_mbuf_append(mbuf, data, data_len); + if (rc) { + os_mbuf_free_chain(mbuf); + return BLE_HS_ENOMEM; + } + + return ble_gap_ext_adv_rsp_set_data(MYNEWT_VAL(BLE_HS_EXT_ADV_LEGACY_INSTANCE), mbuf); +#else struct ble_hci_le_set_scan_rsp_data_cp cmd; uint16_t opcode; @@ -2846,6 +2969,7 @@ ble_gap_adv_rsp_set_data(const uint8_t *data, int data_len) opcode = BLE_HCI_OP(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_SET_SCAN_RSP_DATA); return ble_hs_hci_cmd_tx(opcode, &cmd, sizeof(cmd), NULL, 0); +#endif #else return BLE_HS_ENOTSUP; #endif @@ -2854,7 +2978,7 @@ ble_gap_adv_rsp_set_data(const uint8_t *data, int data_len) int ble_gap_adv_set_fields(const struct ble_hs_adv_fields *adv_fields) { -#if NIMBLE_BLE_ADVERTISE && !MYNEWT_VAL(BLE_EXT_ADV) +#if NIMBLE_BLE_ADVERTISE uint8_t buf[BLE_HS_ADV_MAX_SZ]; uint8_t buf_sz; int rc; @@ -2882,7 +3006,7 @@ ble_gap_adv_set_fields(const struct ble_hs_adv_fields *adv_fields) int ble_gap_adv_rsp_set_fields(const struct ble_hs_adv_fields *rsp_fields) { -#if NIMBLE_BLE_ADVERTISE && !MYNEWT_VAL(BLE_EXT_ADV) +#if NIMBLE_BLE_ADVERTISE uint8_t buf[BLE_HS_ADV_MAX_SZ]; uint8_t buf_sz; int rc; @@ -2907,7 +3031,7 @@ int ble_gap_adv_active(void) { #if NIMBLE_BLE_ADVERTISE - return ble_gap_adv_active_instance(0); + return ble_gap_adv_active_instance(MYNEWT_VAL(BLE_HS_EXT_ADV_LEGACY_INSTANCE)); #else return 0; #endif diff --git a/nimble/host/syscfg.yml b/nimble/host/syscfg.yml index 69db7dfd35..93dbcd2ed9 100644 --- a/nimble/host/syscfg.yml +++ b/nimble/host/syscfg.yml @@ -27,6 +27,13 @@ syscfg.defs: initialization. value: 1 + BLE_HS_EXT_ADV_LEGACY_INSTANCE: + description: > + Advertising instance that is used when extended advertising + support is enabled but legacy GAP API is used. + range: 0..BLE_MULTI_ADV_INSTANCES + value: 0 + # Debug settings. BLE_HS_DEBUG: description: 'Enables extra runtime assertions.' diff --git a/porting/examples/linux/include/syscfg/syscfg.h b/porting/examples/linux/include/syscfg/syscfg.h index e4d2d3a46f..3c62cc3ca4 100644 --- a/porting/examples/linux/include/syscfg/syscfg.h +++ b/porting/examples/linux/include/syscfg/syscfg.h @@ -1,5 +1,5 @@ /** - * This file was generated by Apache newt version: 1.12.0-dev + * This file was generated by Apache newt version: 1.12.0 */ #ifndef H_MYNEWT_SYSCFG_ @@ -15,6 +15,7 @@ #define MYNEWT_VAL(_name) MYNEWT_VAL_ ## _name #define MYNEWT_VAL_CHOICE(_name, _val) MYNEWT_VAL_ ## _name ## __ ## _val +/*** @apache-mynewt-core/crypto/tinycrypt */ #ifndef MYNEWT_VAL_TINYCRYPT_SYSINIT_STAGE #define MYNEWT_VAL_TINYCRYPT_SYSINIT_STAGE (200) #endif @@ -599,8 +600,8 @@ #define MYNEWT_VAL_BLE_ATT_SVR_WRITE_NO_RSP (1) #endif -#ifndef MYNEWT_VAL_BLE_AUDIO_MAX_CODEC_RECORDS -#define MYNEWT_VAL_BLE_AUDIO_MAX_CODEC_RECORDS (0) +#ifndef MYNEWT_VAL_BLE_AUDIO +#define MYNEWT_VAL_BLE_AUDIO (0) #endif #ifndef MYNEWT_VAL_BLE_EATT_CHAN_NUM @@ -727,6 +728,10 @@ #define MYNEWT_VAL_BLE_HS_DEBUG (0) #endif +#ifndef MYNEWT_VAL_BLE_HS_EXT_ADV_LEGACY_INSTANCE +#define MYNEWT_VAL_BLE_HS_EXT_ADV_LEGACY_INSTANCE (0) +#endif + #ifndef MYNEWT_VAL_BLE_HS_FLOW_CTRL #define MYNEWT_VAL_BLE_HS_FLOW_CTRL (0) #endif @@ -775,6 +780,14 @@ #define MYNEWT_VAL_BLE_HS_SYSINIT_STAGE (200) #endif +#ifndef MYNEWT_VAL_BLE_ISO_MAX_BIGS +#define MYNEWT_VAL_BLE_ISO_MAX_BIGS (MYNEWT_VAL_BLE_MULTI_ADV_INSTANCES) +#endif + +#ifndef MYNEWT_VAL_BLE_ISO_MAX_BISES +#define MYNEWT_VAL_BLE_ISO_MAX_BISES (4) +#endif + #ifndef MYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM #define MYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM (0) #endif @@ -807,14 +820,6 @@ #define MYNEWT_VAL_BLE_L2CAP_SIG_MAX_PROCS (1) #endif -#ifndef MYNEWT_VAL_BLE_ISO_MAX_BIGS -#define MYNEWT_VAL_BLE_ISO_MAX_BIGS (MYNEWT_VAL_BLE_MULTI_ADV_INSTANCES) -#endif - -#ifndef MYNEWT_VAL_BLE_ISO_MAX_BISES -#define MYNEWT_VAL_BLE_ISO_MAX_BISES (4) -#endif - #ifndef MYNEWT_VAL_BLE_MESH #define MYNEWT_VAL_BLE_MESH (0) #endif diff --git a/porting/examples/linux/include/sysflash/sysflash.h b/porting/examples/linux/include/sysflash/sysflash.h index 2f4d843f4c..942532360c 100644 --- a/porting/examples/linux/include/sysflash/sysflash.h +++ b/porting/examples/linux/include/sysflash/sysflash.h @@ -1,20 +1,23 @@ /** - * This file was generated by Apache newt version: 1.12.0-dev + * This file was generated by Apache newt version: 1.12.0 */ #ifndef H_MYNEWT_SYSFLASH_ #define H_MYNEWT_SYSFLASH_ -#include "flash_map/flash_map.h" - #define FLASH_AREA_COUNT 6 +/* MYNEWT_SYSFLASH_ONLY_CONST is defined when this header is used for linker script generation */ +#ifndef MYNEWT_SYSFLASH_ONLY_CONST +#include "flash_map/flash_map.h" + /** * This flash map definition is used for two purposes: * 1. To locate the meta area, which contains the true flash map definition. * 2. As a fallback in case the meta area cannot be read from flash. */ extern const struct flash_area sysflash_map_dflt[FLASH_AREA_COUNT]; +#endif /* Flash map was defined in @apache-mynewt-core/hw/bsp/native */ diff --git a/porting/examples/linux_blemesh/include/syscfg/syscfg.h b/porting/examples/linux_blemesh/include/syscfg/syscfg.h index 3919eb1eb0..e16ecb5b14 100644 --- a/porting/examples/linux_blemesh/include/syscfg/syscfg.h +++ b/porting/examples/linux_blemesh/include/syscfg/syscfg.h @@ -1,5 +1,5 @@ /** - * This file was generated by Apache newt version: 1.12.0-dev + * This file was generated by Apache newt version: 1.12.0 */ #ifndef H_MYNEWT_SYSCFG_ @@ -15,6 +15,7 @@ #define MYNEWT_VAL(_name) MYNEWT_VAL_ ## _name #define MYNEWT_VAL_CHOICE(_name, _val) MYNEWT_VAL_ ## _name ## __ ## _val +/*** @apache-mynewt-core/crypto/tinycrypt */ #ifndef MYNEWT_VAL_TINYCRYPT_SYSINIT_STAGE #define MYNEWT_VAL_TINYCRYPT_SYSINIT_STAGE (200) #endif @@ -600,8 +601,8 @@ #define MYNEWT_VAL_BLE_ATT_SVR_WRITE_NO_RSP (1) #endif -#ifndef MYNEWT_VAL_BLE_AUDIO_MAX_CODEC_RECORDS -#define MYNEWT_VAL_BLE_AUDIO_MAX_CODEC_RECORDS (0) +#ifndef MYNEWT_VAL_BLE_AUDIO +#define MYNEWT_VAL_BLE_AUDIO (0) #endif #ifndef MYNEWT_VAL_BLE_EATT_CHAN_NUM @@ -728,6 +729,10 @@ #define MYNEWT_VAL_BLE_HS_DEBUG (0) #endif +#ifndef MYNEWT_VAL_BLE_HS_EXT_ADV_LEGACY_INSTANCE +#define MYNEWT_VAL_BLE_HS_EXT_ADV_LEGACY_INSTANCE (0) +#endif + #ifndef MYNEWT_VAL_BLE_HS_FLOW_CTRL #define MYNEWT_VAL_BLE_HS_FLOW_CTRL (0) #endif @@ -776,6 +781,14 @@ #define MYNEWT_VAL_BLE_HS_SYSINIT_STAGE (200) #endif +#ifndef MYNEWT_VAL_BLE_ISO_MAX_BIGS +#define MYNEWT_VAL_BLE_ISO_MAX_BIGS (MYNEWT_VAL_BLE_MULTI_ADV_INSTANCES) +#endif + +#ifndef MYNEWT_VAL_BLE_ISO_MAX_BISES +#define MYNEWT_VAL_BLE_ISO_MAX_BISES (4) +#endif + #ifndef MYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM #define MYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM (0) #endif @@ -808,14 +821,6 @@ #define MYNEWT_VAL_BLE_L2CAP_SIG_MAX_PROCS (1) #endif -#ifndef MYNEWT_VAL_BLE_ISO_MAX_BIGS -#define MYNEWT_VAL_BLE_ISO_MAX_BIGS (MYNEWT_VAL_BLE_MULTI_ADV_INSTANCES) -#endif - -#ifndef MYNEWT_VAL_BLE_ISO_MAX_BISES -#define MYNEWT_VAL_BLE_ISO_MAX_BISES (4) -#endif - /* Overridden by @apache-mynewt-nimble/porting/targets/linux_blemesh (defined by @apache-mynewt-nimble/nimble/host) */ #ifndef MYNEWT_VAL_BLE_MESH #define MYNEWT_VAL_BLE_MESH (1) diff --git a/porting/examples/linux_blemesh/include/sysflash/sysflash.h b/porting/examples/linux_blemesh/include/sysflash/sysflash.h index 2f4d843f4c..942532360c 100644 --- a/porting/examples/linux_blemesh/include/sysflash/sysflash.h +++ b/porting/examples/linux_blemesh/include/sysflash/sysflash.h @@ -1,20 +1,23 @@ /** - * This file was generated by Apache newt version: 1.12.0-dev + * This file was generated by Apache newt version: 1.12.0 */ #ifndef H_MYNEWT_SYSFLASH_ #define H_MYNEWT_SYSFLASH_ -#include "flash_map/flash_map.h" - #define FLASH_AREA_COUNT 6 +/* MYNEWT_SYSFLASH_ONLY_CONST is defined when this header is used for linker script generation */ +#ifndef MYNEWT_SYSFLASH_ONLY_CONST +#include "flash_map/flash_map.h" + /** * This flash map definition is used for two purposes: * 1. To locate the meta area, which contains the true flash map definition. * 2. As a fallback in case the meta area cannot be read from flash. */ extern const struct flash_area sysflash_map_dflt[FLASH_AREA_COUNT]; +#endif /* Flash map was defined in @apache-mynewt-core/hw/bsp/native */ diff --git a/porting/examples/nuttx/include/syscfg/syscfg.h b/porting/examples/nuttx/include/syscfg/syscfg.h index 16cdc6c005..4740c348c3 100644 --- a/porting/examples/nuttx/include/syscfg/syscfg.h +++ b/porting/examples/nuttx/include/syscfg/syscfg.h @@ -1,5 +1,5 @@ /** - * This file was generated by Apache newt version: 1.12.0-dev + * This file was generated by Apache newt version: 1.12.0 */ #ifndef H_MYNEWT_SYSCFG_ @@ -15,6 +15,7 @@ #define MYNEWT_VAL(_name) MYNEWT_VAL_ ## _name #define MYNEWT_VAL_CHOICE(_name, _val) MYNEWT_VAL_ ## _name ## __ ## _val +/*** @apache-mynewt-core/crypto/tinycrypt */ #ifndef MYNEWT_VAL_TINYCRYPT_SYSINIT_STAGE #define MYNEWT_VAL_TINYCRYPT_SYSINIT_STAGE (200) #endif @@ -599,8 +600,8 @@ #define MYNEWT_VAL_BLE_ATT_SVR_WRITE_NO_RSP (1) #endif -#ifndef MYNEWT_VAL_BLE_AUDIO_MAX_CODEC_RECORDS -#define MYNEWT_VAL_BLE_AUDIO_MAX_CODEC_RECORDS (0) +#ifndef MYNEWT_VAL_BLE_AUDIO +#define MYNEWT_VAL_BLE_AUDIO (0) #endif #ifndef MYNEWT_VAL_BLE_EATT_CHAN_NUM @@ -727,6 +728,10 @@ #define MYNEWT_VAL_BLE_HS_DEBUG (0) #endif +#ifndef MYNEWT_VAL_BLE_HS_EXT_ADV_LEGACY_INSTANCE +#define MYNEWT_VAL_BLE_HS_EXT_ADV_LEGACY_INSTANCE (0) +#endif + #ifndef MYNEWT_VAL_BLE_HS_FLOW_CTRL #define MYNEWT_VAL_BLE_HS_FLOW_CTRL (0) #endif @@ -775,6 +780,14 @@ #define MYNEWT_VAL_BLE_HS_SYSINIT_STAGE (200) #endif +#ifndef MYNEWT_VAL_BLE_ISO_MAX_BIGS +#define MYNEWT_VAL_BLE_ISO_MAX_BIGS (MYNEWT_VAL_BLE_MULTI_ADV_INSTANCES) +#endif + +#ifndef MYNEWT_VAL_BLE_ISO_MAX_BISES +#define MYNEWT_VAL_BLE_ISO_MAX_BISES (4) +#endif + #ifndef MYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM #define MYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM (0) #endif @@ -807,14 +820,6 @@ #define MYNEWT_VAL_BLE_L2CAP_SIG_MAX_PROCS (1) #endif -#ifndef MYNEWT_VAL_BLE_ISO_MAX_BIGS -#define MYNEWT_VAL_BLE_ISO_MAX_BIGS (MYNEWT_VAL_BLE_MULTI_ADV_INSTANCES) -#endif - -#ifndef MYNEWT_VAL_BLE_ISO_MAX_BISES -#define MYNEWT_VAL_BLE_ISO_MAX_BISES (4) -#endif - #ifndef MYNEWT_VAL_BLE_MESH #define MYNEWT_VAL_BLE_MESH (0) #endif diff --git a/porting/examples/nuttx/include/sysflash/sysflash.h b/porting/examples/nuttx/include/sysflash/sysflash.h index 2f4d843f4c..942532360c 100644 --- a/porting/examples/nuttx/include/sysflash/sysflash.h +++ b/porting/examples/nuttx/include/sysflash/sysflash.h @@ -1,20 +1,23 @@ /** - * This file was generated by Apache newt version: 1.12.0-dev + * This file was generated by Apache newt version: 1.12.0 */ #ifndef H_MYNEWT_SYSFLASH_ #define H_MYNEWT_SYSFLASH_ -#include "flash_map/flash_map.h" - #define FLASH_AREA_COUNT 6 +/* MYNEWT_SYSFLASH_ONLY_CONST is defined when this header is used for linker script generation */ +#ifndef MYNEWT_SYSFLASH_ONLY_CONST +#include "flash_map/flash_map.h" + /** * This flash map definition is used for two purposes: * 1. To locate the meta area, which contains the true flash map definition. * 2. As a fallback in case the meta area cannot be read from flash. */ extern const struct flash_area sysflash_map_dflt[FLASH_AREA_COUNT]; +#endif /* Flash map was defined in @apache-mynewt-core/hw/bsp/native */ diff --git a/porting/nimble/include/syscfg/syscfg.h b/porting/nimble/include/syscfg/syscfg.h index 4054f14403..766a5e46e6 100644 --- a/porting/nimble/include/syscfg/syscfg.h +++ b/porting/nimble/include/syscfg/syscfg.h @@ -1,5 +1,5 @@ /** - * This file was generated by Apache newt version: 1.12.0-dev + * This file was generated by Apache newt version: 1.12.0 */ #ifndef H_MYNEWT_SYSCFG_ @@ -15,6 +15,7 @@ #define MYNEWT_VAL(_name) MYNEWT_VAL_ ## _name #define MYNEWT_VAL_CHOICE(_name, _val) MYNEWT_VAL_ ## _name ## __ ## _val +/*** @apache-mynewt-core/crypto/tinycrypt */ #ifndef MYNEWT_VAL_TINYCRYPT_SYSINIT_STAGE #define MYNEWT_VAL_TINYCRYPT_SYSINIT_STAGE (200) #endif @@ -598,8 +599,8 @@ #define MYNEWT_VAL_BLE_ATT_SVR_WRITE_NO_RSP (1) #endif -#ifndef MYNEWT_VAL_BLE_AUDIO_MAX_CODEC_RECORDS -#define MYNEWT_VAL_BLE_AUDIO_MAX_CODEC_RECORDS (0) +#ifndef MYNEWT_VAL_BLE_AUDIO +#define MYNEWT_VAL_BLE_AUDIO (0) #endif #ifndef MYNEWT_VAL_BLE_EATT_CHAN_NUM @@ -726,6 +727,10 @@ #define MYNEWT_VAL_BLE_HS_DEBUG (0) #endif +#ifndef MYNEWT_VAL_BLE_HS_EXT_ADV_LEGACY_INSTANCE +#define MYNEWT_VAL_BLE_HS_EXT_ADV_LEGACY_INSTANCE (0) +#endif + #ifndef MYNEWT_VAL_BLE_HS_FLOW_CTRL #define MYNEWT_VAL_BLE_HS_FLOW_CTRL (0) #endif @@ -774,6 +779,14 @@ #define MYNEWT_VAL_BLE_HS_SYSINIT_STAGE (200) #endif +#ifndef MYNEWT_VAL_BLE_ISO_MAX_BIGS +#define MYNEWT_VAL_BLE_ISO_MAX_BIGS (MYNEWT_VAL_BLE_MULTI_ADV_INSTANCES) +#endif + +#ifndef MYNEWT_VAL_BLE_ISO_MAX_BISES +#define MYNEWT_VAL_BLE_ISO_MAX_BISES (4) +#endif + #ifndef MYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM #define MYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM (0) #endif @@ -806,14 +819,6 @@ #define MYNEWT_VAL_BLE_L2CAP_SIG_MAX_PROCS (1) #endif -#ifndef MYNEWT_VAL_BLE_ISO_MAX_BIGS -#define MYNEWT_VAL_BLE_ISO_MAX_BIGS (MYNEWT_VAL_BLE_MULTI_ADV_INSTANCES) -#endif - -#ifndef MYNEWT_VAL_BLE_ISO_MAX_BISES -#define MYNEWT_VAL_BLE_ISO_MAX_BISES (4) -#endif - #ifndef MYNEWT_VAL_BLE_MESH #define MYNEWT_VAL_BLE_MESH (0) #endif diff --git a/porting/nimble/include/sysflash/sysflash.h b/porting/nimble/include/sysflash/sysflash.h index 2f4d843f4c..942532360c 100644 --- a/porting/nimble/include/sysflash/sysflash.h +++ b/porting/nimble/include/sysflash/sysflash.h @@ -1,20 +1,23 @@ /** - * This file was generated by Apache newt version: 1.12.0-dev + * This file was generated by Apache newt version: 1.12.0 */ #ifndef H_MYNEWT_SYSFLASH_ #define H_MYNEWT_SYSFLASH_ -#include "flash_map/flash_map.h" - #define FLASH_AREA_COUNT 6 +/* MYNEWT_SYSFLASH_ONLY_CONST is defined when this header is used for linker script generation */ +#ifndef MYNEWT_SYSFLASH_ONLY_CONST +#include "flash_map/flash_map.h" + /** * This flash map definition is used for two purposes: * 1. To locate the meta area, which contains the true flash map definition. * 2. As a fallback in case the meta area cannot be read from flash. */ extern const struct flash_area sysflash_map_dflt[FLASH_AREA_COUNT]; +#endif /* Flash map was defined in @apache-mynewt-core/hw/bsp/native */ diff --git a/porting/npl/riot/include/syscfg/syscfg.h b/porting/npl/riot/include/syscfg/syscfg.h index 1c46e12a63..a5634aed78 100644 --- a/porting/npl/riot/include/syscfg/syscfg.h +++ b/porting/npl/riot/include/syscfg/syscfg.h @@ -1,5 +1,5 @@ /** - * This file was generated by Apache newt version: 1.12.0-dev + * This file was generated by Apache newt version: 1.12.0 */ #ifndef H_MYNEWT_SYSCFG_ @@ -15,6 +15,7 @@ #define MYNEWT_VAL(_name) MYNEWT_VAL_ ## _name #define MYNEWT_VAL_CHOICE(_name, _val) MYNEWT_VAL_ ## _name ## __ ## _val +/*** @apache-mynewt-core/compiler/arm-none-eabi-m4 */ #ifndef MYNEWT_VAL_HARDFLOAT #define MYNEWT_VAL_HARDFLOAT (0) #endif @@ -1205,7 +1206,6 @@ #define MYNEWT_VAL_BLE_LL_ISO (0) #endif -/* Value copied from BLE_LL_ISO_BROADCASTER */ #ifndef MYNEWT_VAL_BLE_LL_ISO_BROADCASTER #define MYNEWT_VAL_BLE_LL_ISO_BROADCASTER (0) #endif @@ -1515,8 +1515,8 @@ #define MYNEWT_VAL_BLE_ATT_SVR_WRITE_NO_RSP (1) #endif -#ifndef MYNEWT_VAL_BLE_AUDIO_MAX_CODEC_RECORDS -#define MYNEWT_VAL_BLE_AUDIO_MAX_CODEC_RECORDS (0) +#ifndef MYNEWT_VAL_BLE_AUDIO +#define MYNEWT_VAL_BLE_AUDIO (0) #endif #ifndef MYNEWT_VAL_BLE_EATT_CHAN_NUM @@ -1643,6 +1643,10 @@ #define MYNEWT_VAL_BLE_HS_DEBUG (0) #endif +#ifndef MYNEWT_VAL_BLE_HS_EXT_ADV_LEGACY_INSTANCE +#define MYNEWT_VAL_BLE_HS_EXT_ADV_LEGACY_INSTANCE (0) +#endif + #ifndef MYNEWT_VAL_BLE_HS_FLOW_CTRL #define MYNEWT_VAL_BLE_HS_FLOW_CTRL (0) #endif @@ -1691,6 +1695,14 @@ #define MYNEWT_VAL_BLE_HS_SYSINIT_STAGE (200) #endif +#ifndef MYNEWT_VAL_BLE_ISO_MAX_BIGS +#define MYNEWT_VAL_BLE_ISO_MAX_BIGS (MYNEWT_VAL_BLE_MULTI_ADV_INSTANCES) +#endif + +#ifndef MYNEWT_VAL_BLE_ISO_MAX_BISES +#define MYNEWT_VAL_BLE_ISO_MAX_BISES (4) +#endif + #ifndef MYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM #define MYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM (0) #endif @@ -1723,14 +1735,6 @@ #define MYNEWT_VAL_BLE_L2CAP_SIG_MAX_PROCS (1) #endif -#ifndef MYNEWT_VAL_BLE_ISO_MAX_BIGS -#define MYNEWT_VAL_BLE_ISO_MAX_BIGS (MYNEWT_VAL_BLE_MULTI_ADV_INSTANCES) -#endif - -#ifndef MYNEWT_VAL_BLE_ISO_MAX_BISES -#define MYNEWT_VAL_BLE_ISO_MAX_BISES (4) -#endif - #ifndef MYNEWT_VAL_BLE_MESH #define MYNEWT_VAL_BLE_MESH (0) #endif diff --git a/porting/npl/riot/include/sysflash/sysflash.h b/porting/npl/riot/include/sysflash/sysflash.h index 0194dc49a8..8710e9d3b5 100644 --- a/porting/npl/riot/include/sysflash/sysflash.h +++ b/porting/npl/riot/include/sysflash/sysflash.h @@ -1,20 +1,23 @@ /** - * This file was generated by Apache newt version: 1.12.0-dev + * This file was generated by Apache newt version: 1.12.0 */ #ifndef H_MYNEWT_SYSFLASH_ #define H_MYNEWT_SYSFLASH_ -#include "flash_map/flash_map.h" - #define FLASH_AREA_COUNT 6 +/* MYNEWT_SYSFLASH_ONLY_CONST is defined when this header is used for linker script generation */ +#ifndef MYNEWT_SYSFLASH_ONLY_CONST +#include "flash_map/flash_map.h" + /** * This flash map definition is used for two purposes: * 1. To locate the meta area, which contains the true flash map definition. * 2. As a fallback in case the meta area cannot be read from flash. */ extern const struct flash_area sysflash_map_dflt[FLASH_AREA_COUNT]; +#endif /* Flash map was defined in @apache-mynewt-core/hw/bsp/nordic_pca10056 */