Skip to content

Bluetooth: Host: BT_DEVICE_NAME should be mutually exclusive with BT_DEVICE_NAME_DYNAMIC #93769

@Thalley

Description

@Thalley

Summary

The 2 Kconfig options should be mutually exclusive, i.e. if CONFIG_BT_DEVICE_NAME_DYNAMIC=y, then CONFIG_BT_DEVICE_NAME should not be set-able.

The reason for this is to avoid cases where e.g. CONFIG_BT_DEVICE_NAME_DYNAMIC=y and applications mistakenly use CONFIG_BT_DEVICE_NAME when e.g. advertising instead of bt_get_name and may thus advertise the wrong name.

Describe the solution you'd like

Modify

config BT_DEVICE_NAME
	string "Bluetooth device name"
	default "Zephyr"
	help
	  Bluetooth device name. Name can be up to 248 bytes long (excluding
	  NULL termination). Can be empty string.

to be

config BT_DEVICE_NAME
	string "Bluetooth device name" if !BT_DEVICE_NAME_DYNAMIC
	default "Zephyr"
	default "" if BT_DEVICE_NAME_DYNAMIC
	help
	  Bluetooth device name. Name can be up to 248 bytes long (excluding
	  NULL termination). Can be empty string.

or

config BT_DEVICE_NAME
	string "Bluetooth device name" 
	depends on !BT_DEVICE_NAME_DYNAMIC
	default "Zephyr"
	help
	  Bluetooth device name. Name can be up to 248 bytes long (excluding
	  NULL termination). Can be empty string.

Alternatives

No response

Additional Context

No response

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions