LE Audio 相关资料最容易写错的地方有两个:
所以这页不去堆手写结构体,而是按当前 Zephyr sample 族来整理。
zephyr/samples/bluetooth/bap_unicast_serverzephyr/samples/bluetooth/bap_unicast_clientzephyr/samples/bluetooth/bap_broadcast_sourcezephyr/samples/bluetooth/bap_broadcast_sinkzephyr/samples/bluetooth/bap_broadcast_assistantzephyr/samples/bluetooth/cap_acceptorzephyr/samples/bluetooth/cap_initiatorzephyr/samples/bluetooth/tmap_peripheralzephyr/samples/bluetooth/tmap_centralzephyr/samples/bluetooth/tmap_bmszephyr/samples/bluetooth/tmap_bmrLE Audio 资料里最容易出现大量:
BT_AUDIO_*BT_BAP_*BT_CAP_*这些枚举、宏和结构体会随版本演进。 学习时先对照 sample 和真实头文件,再决定自己项目里保留哪些能力。
bap_unicast_server/client 理解单播流bap_broadcast_source/sink 理解广播流cap_* / tmap_* 理解更完整产品角色当前 Zephyr sample 里,LE Audio 相关示例经常带有:
nrf5340_audio_dk_nrf5340_cpuapp这说明很多完整场景默认围绕 nRF5340 Audio DK 来组织。 如果你换到别的板卡,通常需要重新处理:
CONFIG_BT_AUDIO_* 数值当通用模板BT_AUDIO_LOCATION_* 表当成你必须自定义的宏bap_broadcast_sourcebap_broadcast_sinkbap_unicast_serverbap_unicast_clientcap_acceptor / cap_initiatortmap_*zephyr/samples/bluetooth/bap_unicast_serverzephyr/samples/bluetooth/bap_unicast_clientzephyr/samples/bluetooth/bap_broadcast_sourcezephyr/samples/bluetooth/bap_broadcast_sinkzephyr/samples/bluetooth/cap_acceptorzephyr/samples/bluetooth/cap_initiatorzephyr/samples/bluetooth/tmap_*