Merge branch 'feat/exposed_gap_service_macros_to_menuconfig_v5.1' into 'release/v5.1'

feat(nimble): Exposed macros used by GAP service to menuconfig (v5.1)

See merge request espressif/esp-idf!29505
This commit is contained in:
Rahul Tank 2024-03-12 12:22:23 +08:00
commit f93025b7f9
2 changed files with 184 additions and 7 deletions

View File

@ -699,6 +699,164 @@ config BT_NIMBLE_BLE_GATT_BLOB_TRANSFER
This option is used when data to be sent is more than 512 bytes. For peripheral role, This option is used when data to be sent is more than 512 bytes. For peripheral role,
BT_NIMBLE_MSYS_1_BLOCK_COUNT needs to be increased according to the need. BT_NIMBLE_MSYS_1_BLOCK_COUNT needs to be increased according to the need.
menu "GAP Service"
menu "GAP Appearance write permissions"
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE
bool "Write"
default n
help
Enable write permission (BLE_GATT_CHR_F_WRITE)
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_ENC
depends on BT_NIMBLE_SVC_GAP_APPEAR_WRITE
bool "Write with encryption"
default n
help
Enable write with encryption permission (BLE_GATT_CHR_F_WRITE_ENC)
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHEN
depends on BT_NIMBLE_SVC_GAP_APPEAR_WRITE
bool "Write with authentication"
default n
help
Enable write with authentication permission (BLE_GATT_CHR_F_WRITE_AUTHEN)
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHOR
depends on BT_NIMBLE_SVC_GAP_APPEAR_WRITE
bool "Write with authorisation"
default n
help
Enable write with authorisation permission (BLE_GATT_CHR_F_WRITE_AUTHOR)
endmenu
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM
int
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE
default 8 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ENC
int
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE_ENC
default 4096 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE_ENC
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ATHN
int
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHEN
default 8192 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHEN
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ATHR
int
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHOR
default 16384 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHOR
choice BT_NIMBLE_SVC_GAP_CENT_ADDR_RESOLUTION
prompt "GAP Characteristic - Central Address Resolution"
default BT_NIMBLE_SVC_GAP_CAR_CHAR_NOT_SUPP
help
Weather or not Central Address Resolution characteristic is supported on
the device, and if supported, weather or not Central Address Resolution
is supported.
- Central Address Resolution characteristic not supported
- Central Address Resolution not supported
- Central Address Resolution supported
config BT_NIMBLE_SVC_GAP_CAR_CHAR_NOT_SUPP
bool "Characteristic not supported"
config BT_NIMBLE_SVC_GAP_CAR_NOT_SUPP
bool "Central Address Resolution not supported"
config BT_NIMBLE_SVC_GAP_CAR_SUPP
bool "Central Address Resolution supported"
endchoice
config BT_NIMBLE_SVC_GAP_CENT_ADDR_RESOLUTION
int
default -1 if BT_NIMBLE_SVC_GAP_CAR_CHAR_NOT_SUPP
default 0 if BT_NIMBLE_SVC_GAP_CAR_NOT_SUPP
default 1 if BT_NIMBLE_SVC_GAP_CAR_SUPP
menu "GAP device name write permissions"
config BT_NIMBLE_SVC_GAP_NAME_WRITE
bool "Write"
default n
help
Enable write permission (BLE_GATT_CHR_F_WRITE)
config BT_NIMBLE_SVC_GAP_NAME_WRITE_ENC
depends on BT_NIMBLE_SVC_GAP_NAME_WRITE
bool "Write with encryption"
default n
help
Enable write with encryption permission (BLE_GATT_CHR_F_WRITE_ENC)
config BT_NIMBLE_SVC_GAP_NAME_WRITE_AUTHEN
depends on BT_NIMBLE_SVC_GAP_NAME_WRITE
bool "Write with authentication"
default n
help
Enable write with authentication permission (BLE_GATT_CHR_F_WRITE_AUTHEN)
config BT_NIMBLE_SVC_GAP_NAME_WRITE_AUTHOR
depends on BT_NIMBLE_SVC_GAP_NAME_WRITE
bool "Write with authorisation"
default n
help
Enable write with authorisation permission (BLE_GATT_CHR_F_WRITE_AUTHOR)
endmenu
config BT_NIMBLE_SVC_GAP_NAME_WRITE_PERM
int
default 0 if !BT_NIMBLE_SVC_GAP_NAME_WRITE
default 8 if BT_NIMBLE_SVC_GAP_NAME_WRITE
config BT_NIMBLE_SVC_GAP_NAME_WRITE_PERM_ENC
int
default 0 if !BT_NIMBLE_SVC_GAP_NAME_WRITE_ENC
default 4096 if BT_NIMBLE_SVC_GAP_NAME_WRITE_ENC
config BT_NIMBLE_SVC_GAP_NAME_WRITE_PERM_AUTHEN
int
default 0 if !BT_NIMBLE_SVC_GAP_NAME_WRITE_AUTHEN
default 8192 if BT_NIMBLE_SVC_GAP_NAME_WRITE_AUTHEN
config BT_NIMBLE_SVC_GAP_NAME_WRITE_PERM_AUTHOR
int
default 0 if !BT_NIMBLE_SVC_GAP_NAME_WRITE_AUTHOR
default 16384 if BT_NIMBLE_SVC_GAP_NAME_WRITE_AUTHOR
config BT_NIMBLE_SVC_GAP_PPCP_MAX_CONN_INTERVAL
int "PPCP Connection Interval Max (Unit: 1.25 ms)"
depends on BT_NIMBLE_ROLE_PERIPHERAL
default 0
help
Peripheral Preferred Connection Parameter: Connection Interval maximum value
Interval Max = value * 1.25 ms
config BT_NIMBLE_SVC_GAP_PPCP_MIN_CONN_INTERVAL
int "PPCP Connection Interval Min (Unit: 1.25 ms)"
depends on BT_NIMBLE_ROLE_PERIPHERAL
default 0
help
Peripheral Preferred Connection Parameter: Connection Interval minimum value
Interval Min = value * 1.25 ms
config BT_NIMBLE_SVC_GAP_PPCP_SLAVE_LATENCY
int "PPCP Slave Latency"
default 0
help
Peripheral Preferred Connection Parameter: Slave Latency
config BT_NIMBLE_SVC_GAP_PPCP_SUPERVISION_TMO
int "PPCP Supervision Timeout (Uint: 10 ms)"
default 0
help
Peripheral Preferred Connection Parameter: Supervision Timeout
Timeout = Value * 10 ms
endmenu
menu "BLE Services" menu "BLE Services"
menuconfig BT_NIMBLE_HID_SERVICE menuconfig BT_NIMBLE_HID_SERVICE
bool "HID service" bool "HID service"

View File

@ -1613,11 +1613,19 @@
#endif #endif
#ifndef MYNEWT_VAL_BLE_SVC_GAP_APPEARANCE_WRITE_PERM #ifndef MYNEWT_VAL_BLE_SVC_GAP_APPEARANCE_WRITE_PERM
#if CONFIG_BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM
#define MYNEWT_VAL_BLE_SVC_GAP_APPEARANCE_WRITE_PERM ( \
CONFIG_BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ENC | \
CONFIG_BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ATHN | \
CONFIG_BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ATHR)
#else
#define MYNEWT_VAL_BLE_SVC_GAP_APPEARANCE_WRITE_PERM (-1) #define MYNEWT_VAL_BLE_SVC_GAP_APPEARANCE_WRITE_PERM (-1)
#endif #endif //CONFIG_BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM
#endif //MYNEWT_VAL_BLE_SVC_GAP_APPEARANCE_WRITE_PERM
#ifndef MYNEWT_VAL_BLE_SVC_GAP_CENTRAL_ADDRESS_RESOLUTION #ifndef MYNEWT_VAL_BLE_SVC_GAP_CENTRAL_ADDRESS_RESOLUTION
#define MYNEWT_VAL_BLE_SVC_GAP_CENTRAL_ADDRESS_RESOLUTION (-1) #define MYNEWT_VAL_BLE_SVC_GAP_CENTRAL_ADDRESS_RESOLUTION \
CONFIG_BT_NIMBLE_SVC_GAP_CENT_ADDR_RESOLUTION
#endif #endif
#ifndef CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME #ifndef CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME
@ -1631,23 +1639,34 @@
#endif #endif
#ifndef MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME_WRITE_PERM #ifndef MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME_WRITE_PERM
#if CONFIG_BT_NIMBLE_SVC_GAP_NAME_WRITE_PERM
#define MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME_WRITE_PERM ( \
CONFIG_BT_NIMBLE_SVC_GAP_NAME_WRITE_PERM_ENC | \
CONFIG_BT_NIMBLE_SVC_GAP_NAME_WRITE_PERM_AUTHEN | \
CONFIG_BT_NIMBLE_SVC_GAP_NAME_WRITE_PERM_AUTHOR)
#else
#define MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME_WRITE_PERM (-1) #define MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME_WRITE_PERM (-1)
#endif #endif //CONFIG_BT_NIMBLE_SVC_GAP_NAME_WRITE_PERM
#endif //MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME_WRITE_PERM
#ifndef MYNEWT_VAL_BLE_SVC_GAP_PPCP_MAX_CONN_INTERVAL #ifndef MYNEWT_VAL_BLE_SVC_GAP_PPCP_MAX_CONN_INTERVAL
#define MYNEWT_VAL_BLE_SVC_GAP_PPCP_MAX_CONN_INTERVAL (0) #define MYNEWT_VAL_BLE_SVC_GAP_PPCP_MAX_CONN_INTERVAL \
CONFIG_BT_NIMBLE_SVC_GAP_PPCP_MAX_CONN_INTERVAL
#endif #endif
#ifndef MYNEWT_VAL_BLE_SVC_GAP_PPCP_MIN_CONN_INTERVAL #ifndef MYNEWT_VAL_BLE_SVC_GAP_PPCP_MIN_CONN_INTERVAL
#define MYNEWT_VAL_BLE_SVC_GAP_PPCP_MIN_CONN_INTERVAL (0) #define MYNEWT_VAL_BLE_SVC_GAP_PPCP_MIN_CONN_INTERVAL \
CONFIG_BT_NIMBLE_SVC_GAP_PPCP_MIN_CONN_INTERVAL
#endif #endif
#ifndef MYNEWT_VAL_BLE_SVC_GAP_PPCP_SLAVE_LATENCY #ifndef MYNEWT_VAL_BLE_SVC_GAP_PPCP_SLAVE_LATENCY
#define MYNEWT_VAL_BLE_SVC_GAP_PPCP_SLAVE_LATENCY (0) #define MYNEWT_VAL_BLE_SVC_GAP_PPCP_SLAVE_LATENCY \
CONFIG_BT_NIMBLE_SVC_GAP_PPCP_SLAVE_LATENCY
#endif #endif
#ifndef MYNEWT_VAL_BLE_SVC_GAP_PPCP_SUPERVISION_TMO #ifndef MYNEWT_VAL_BLE_SVC_GAP_PPCP_SUPERVISION_TMO
#define MYNEWT_VAL_BLE_SVC_GAP_PPCP_SUPERVISION_TMO (0) #define MYNEWT_VAL_BLE_SVC_GAP_PPCP_SUPERVISION_TMO \
CONFIG_BT_NIMBLE_SVC_GAP_PPCP_SUPERVISION_TMO
#endif #endif
/*** nimble/transport */ /*** nimble/transport */