An Apache open-source Bluetooth 5.0 stack porting on RT-Thread
NimBLE 软件包是 RT-Thread 基于 Apache NimBLE 开源蓝牙 5.0 协议栈的移植实现,该协议栈提供完整的 Host 层和 Controller 层支持,1.0 版本支持 Nordic nRF51 和 nRF52 系列芯片完整部署;最新版本可实现 RT-Thread 下支持 Host 层搭配串口连接外部 Controller 芯片使用。
更多关于 NimBLE Stack 的介绍请参考 http://mynewt.apache.org/latest/network/docs/index.html
。
📦NimBLE
┣ 📂apps
┣ 📂docs
┣ 📂ext
┣ 📂nimble
┣ 📂porting
┗ 📂targets
NimBLE
├───apps /* Bluetooth 示例应用程序 */
│ ├───advertiser
│ ├───blecent
│ ├───blecsc
│ ├───blehci
│ ├───blehr
│ ├───blemesh
│ ├───blemesh_light
│ ├───blemesh_shell
│ ├───bleprph
│ ├───bleuart
│ ├───btshell
│ ├───ext_advertiser
│ └───ibeacon
├───docs /* 官方文档及 API 说明 */
├───ext
│ └───tinycrypt /* Tinycrypt 加密库 */
├───nimble
│ ├───controller /* Controller 实现 */
│ │ ├───include
│ │ └───src
│ ├───drivers /* Nordic 系列 Phy 驱动 */
│ │ ├───nrf51
│ │ └───nrf52
│ ├───host /* Host Stack(主机控制器)实现 */
│ │ ├───include
│ │ ├───mesh /* Mesh 组网功能 */
│ │ ├───pts /* PTS 测试相关 */
│ │ ├───services /* 通用的 Profile */
│ │ │ ├───ans
│ │ │ ├───bas
│ │ │ ├───bleuart
│ │ │ ├───dis
│ │ │ ├───gap
│ │ │ ├───gatt
│ │ │ ├───ias
│ │ │ ├───lls
│ │ │ └───tps
│ │ ├───src
│ │ ├───store
│ │ ├───tools
│ │ └───util
│ ├───include
│ │ └───nimble
│ ├───src
│ └───transport /* HCI 传输抽象层 */
│ ├───common /* h4 协议工具 */
│ ├───include
│ └───rtthread /* RT-Thread UART 对接 HCI 层代码 */
└───porting /* OS 抽象层及系统配置 */
├───nimble
│ ├───include
│ └───src
└───npl
└───rtthread /* RT-Thread OS 接口实现 */
├───include
│ ├───config /* NimBLE 协议栈配置选项 */
│ ├───console
│ ├───logcfg /* RT-Thread rtdbg 日志对接 */
│ └───nimble
└───src
NimBLE 软件包遵循 Apache-2.0 许可,详见 LICENSE 文件。
使用 NimBLE 软件包需要在 RT-Thread 的包管理中选中它,具体路径如下:
RT-Thread online packages
IoT - internet of things --->
--- NimBLE:An open-source Bluetooth 5.0 stack porting on RT-Thread
Bluetooth Role support --->
Host Stack Configuration --->
Controller Configuration --->
Bluetooth Mesh support --->
HCI Transport support ---->
Device Driver support ----
Log level (INFO) --->
Bluetooth Samples (Not enable sample) --->
(1) Maximum number of concurrent connections
[*] Device Whitelist Support
(0) The number of multi-advertising instances
[ ] Extended Advertising Feature Support
Version (latest) --->
Bluetooth Role support : 配置 BLE角色支持(Central/Peripheral/Broadcaster/Observer) ;
Host Stack Configuration : 配置 Host 相关功能;
Controller Configuration : 配置 Controller 相关功能;
Bluetooth Mesh support : Mesh 特性支持及配置;
HCI Transport support : 配置HCI层传输方式 ;
Device Driver support : 底层 SOC Phy 支持 ;
Log level (INFO) : 配置协议栈日志等级;
Bluetooth Samples : 配置示例应用;
Version : 软件包版本选择;
配置完成后让 RT-Thread 的包管理器自动更新,或者使用 pkgs --update 命令更新包到 BSP 中。
1.0 版本配合独立的 nrf52832-nimble bsp 使用,参考 https://github.com/EvalZero/nrf52832-nimble 。
最新版本特性支持 RT-Thread 搭配 UART 外接蓝牙Controller卡片使用,参考以下文档:
外部蓝牙 Controller 选择及固件可参考 蓝牙控制器固件