diff options
author | Christopher Collins <ccollins@apache.org> | 2016-08-23 17:35:28 -0700 |
---|---|---|
committer | Christopher Collins <ccollins@apache.org> | 2016-08-23 17:35:28 -0700 |
commit | 70987f7d2e3c791132509f08566fe77de34142ac (patch) | |
tree | 269ca9b857f65c22b8f2b93560466984f96091e5 /net/nimble/host/include/host/ble_hs_adv.h | |
parent | 0d9c8f30efbe2dba00b21d9185e9db8e36cd579e (diff) | |
parent | 665e22f5722d6348c1b260192e27f69d855b58fd (diff) |
Merge branch 'develop' - in preparation for
backwards-compatibility-breaking changes to develop.
* develop: (290 commits)
sim compiler - replace objsize with size
Fix warnings reported by clang.
MYNEWT-329
MYNEWT-354
STM32f407 discovery board BSP
mbedtls; use smaller version of SHA256.
boot; boot loader does not need to call os_init() anymore, as bsp_init() has been exported.
boot; app does not need the dependency to mbedtls
slinky; time-based waits must use OS_TICKS_PER_SEC.
bootutil; adjust unit tests to work with status upkeep outside sys/config.
bootutil; was returning wrong image header in response when swithing images. Add boot_set_req() routine for unit test use.
boot/bootutil; remove debug console use from bootloader.
bootutil/imgmgr; output of boot now shows the fallback image.
imgmgr; automatically confirm image as good for now.
bootutil; add 'confirm' step, telling that image was confirmed as good. Otherwise next restart we'll go back to old image.
bootutil; make status element size depend on flash alignment restrictions.
boot, imgmgr; return the slot number for test image.
bootutil; move routines reading boot-copy-status from loader.c to bootutil_misc.c.
boot; return full flash location of status bytes, instead of just offset.
boot; don't use NFFS or FCB for keeping status. Interim commit.
...
Diffstat (limited to 'net/nimble/host/include/host/ble_hs_adv.h')
-rw-r--r-- | net/nimble/host/include/host/ble_hs_adv.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/net/nimble/host/include/host/ble_hs_adv.h b/net/nimble/host/include/host/ble_hs_adv.h index 0377d1d9..8ae2b00b 100644 --- a/net/nimble/host/include/host/ble_hs_adv.h +++ b/net/nimble/host/include/host/ble_hs_adv.h @@ -22,18 +22,21 @@ #include <inttypes.h> +/** Max field payload size (account for 2-byte header). */ +#define BLE_HS_ADV_MAX_FIELD_SZ (BLE_HCI_MAX_ADV_DATA_LEN - 2) + struct ble_hs_adv_fields { /*** 0x01 - Flags. */ uint8_t flags; unsigned flags_is_present:1; /*** 0x02,0x03 - 16-bit service class UUIDs. */ - void *uuids16; + uint16_t *uuids16; uint8_t num_uuids16; unsigned uuids16_is_complete:1; /*** 0x04,0x05 - 32-bit service class UUIDs. */ - void *uuids32; + uint32_t *uuids32; uint8_t num_uuids32; unsigned uuids32_is_complete:1; @@ -48,7 +51,7 @@ struct ble_hs_adv_fields { unsigned name_is_complete:1; /*** 0x0a - Tx power level. */ - uint8_t tx_pwr_lvl; + int8_t tx_pwr_lvl; unsigned tx_pwr_lvl_is_present:1; /*** 0x0d - Class of device. */ @@ -141,6 +144,12 @@ struct ble_hs_adv_fields { #define BLE_HS_ADV_TX_PWR_LVL_LEN 1 +/** + * Set the tx_pwr_lvl field to this if you want the stack to fill in the tx + * power level field. + */ +#define BLE_HS_ADV_TX_PWR_LVL_AUTO (-128) + #define BLE_HS_ADV_DEVICE_CLASS_LEN 3 #define BLE_HS_ADV_SLAVE_ITVL_RANGE_LEN 4 @@ -165,10 +174,4 @@ struct ble_hs_adv_fields { #define BLE_HS_ADV_SVC_DATA_UUID128_MIN_LEN 16 -int ble_hs_adv_set_flat(uint8_t type, int data_len, void *data, - uint8_t *dst, uint8_t *dst_len, uint8_t max_len); -int ble_hs_adv_set_fields(struct ble_hs_adv_fields *adv_fields, - uint8_t *dst, uint8_t *dst_len, uint8_t max_len); -int ble_hs_adv_parse_fields(struct ble_hs_adv_fields *adv_fields, uint8_t *src, - uint8_t src_len); #endif |