• Stars
    star
    128
  • Rank 280,995 (Top 6 %)
  • Language
    C
  • License
    Apache License 2.0
  • Created almost 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An Apache open-source Bluetooth 5.0 stack porting on RT-Thread

RT-THREAD NIMBLE

nimble BLE STACK for RT-THREAD

1 介绍

NimBLE 软件包是 RT-Thread 基于 Apache NimBLE 开源蓝牙 5.0 协议栈的移植实现,该协议栈提供完整的 Host 层和 Controller 层支持,1.0 版本支持 Nordic nRF51 和 nRF52 系列芯片完整部署;最新版本可实现 RT-Thread 下支持 Host 层搭配串口连接外部 Controller 芯片使用。

1.1 主要特性

  • 扩展广播(LE Advertising Extensions)
  • 2Mbit/s比特率的物理层
  • 长距离编码(Coded PHY for LE Long Range)
  • 高速不可连接广播(High Duty Cycle Non-Connectable Advertising)
  • 新的跳频算法(Channel Selection Algorithm #2)
  • 隐私1.2(LE Privacy 1.2)
  • 安全管理(SM),支持传统配对(LE Legacy Pairing),安全连接(LE Secure Connections),特定秘钥分发(Transport Specific Key Distribution)
  • 链路层PDU数据长度扩展(LE Data Length Extension)
  • 多角色并发(主机(central)/从机(peripheral), server/client)
  • 同时广播和扫描
  • 低速定向广播(Low Duty Cycle Directed Advertising)
  • 连接参数请求(Connection parameters request procedure)
  • LE Ping
  • 完整的GATT客户端,服务端,以及子功能
  • 抽象HCI接口层

1.2 Profile和Service支持

  • 警报通知服务(ANS)
  • 即时报警服务(IAS)
  • 链路丢失服务(LLS)
  • 电池服务(BAS)
  • 设备信息服务(DIS)
  • 心率服务(HRS)
  • 自行车速度及步调(CSC)
  • 射频功率(TPS)

1.3 Mesh 特性

  • 广播和GATT承载(Advertising and GATT bearers)
  • PB-GATT 和 PB-ADV provisioning
  • 模型层(Foundation Models (server role))
  • 支持中继(Relay support)
  • 支持GATT代理(GATT Proxy)

更多关于 NimBLE Stack 的介绍请参考 http://mynewt.apache.org/latest/network/docs/index.html

1.4 目录结构

    📦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

1.5 许可证

NimBLE 软件包遵循 Apache-2.0 许可,详见 LICENSE 文件。

1.6 依赖

  • RT_Thread 3.0+

2 获取软件包

使用 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 中。

3 使用 NimBLE 软件包

1.0 版本配合独立的 nrf52832-nimble bsp 使用,参考 https://github.com/EvalZero/nrf52832-nimble

最新版本特性支持 RT-Thread 搭配 UART 外接蓝牙Controller卡片使用,参考以下文档:

外部蓝牙 Controller 选择及固件可参考 蓝牙控制器固件

4 注意事项

  • 如需使用 NimBLE Host层 和 Controller层完整部署,则需选择 1.0 版本运行。
  • 1.0 版本暂时只支持 Nodic nRF52832 nRF52840 MCU,参见 nrf52832-bsp
  • 最新版本目前仅能在 RT-Thread 上部署 Host 层,需要使用串口搭配外部蓝牙 Controller 芯片使用。
  • 文档中心相关资料:RT-Thread 标准版 -> 软件包 -> NimBLE 用户手册

5 联系方式 & 感谢

More Repositories

1

at_device

AT component porting or samples for different devices
C
214
star
2

freemodbus

A Modbus ASCII/RTU and TCP implementation
C
211
star
3

fal

Flash Abstraction Layer implentment. Manage flash device and partition.
C
130
star
4

rt-robot

a platform in creating new exciting robots
C
112
star
5

kernel-sample

RT-Thread kernel samples
C
81
star
6

netutils

IoT networking utilities for RT-Thread. Such as: ping, tftp, iperf, netio, ntp, telnet and tcpdump.
C
71
star
7

webclient

http client library by RT-Thread
C
67
star
8

ota_downloader

The firmware downloader which using on RT-Thread OTA component.
C
65
star
9

gui_engine

Graphics Engine (GE) in RT-Thread
C
53
star
10

wiznet

WIZnet TCP/IP chips (such as W5500/W5100..) SAL framework implement.
C
49
star
11

webnet

A lightweight, customizable embedded Web Server for RT-Thread
C
48
star
12

paho-mqtt

Eclipse Paho MQTT C/C++ client for Embedded platforms
C
43
star
13

ppp_device

lwIP PPP porting for GSM modem (like sim800)
C
39
star
14

mbedtls

An open source, portable, easy to use, readable and flexible SSL library
C
36
star
15

tinycrypt

A simple and configurable crypt library
C
34
star
16

quicklz

the world's fastest compression library
C
33
star
17

qrcode

A simple library for generating QR codes in C.
C
31
star
18

ali-iotkit

Ali Cloud SDK for IoT platform
C
30
star
19

cmux

connection multiplexing protocol for RT-Thread, support GSM0710 .etc
C
30
star
20

umqtt

A light weight, powerful, customizable, easy-to-use and embeddable mqtt client for RT-Thread
C
27
star
21

miniLZO

A mini subset of the LZO real-time data compression library
C
26
star
22

mpu-6xxx

a package of mpu6xxx driver library, compatible with mpu6000, mpu6050, mpu6500, mpu9250 and other chips.
C
25
star
23

FreeRTOS-Wrapper

RT-Thread操作系统的FreeRTOS兼容层 | FreeRTOS Application Compatibility Layer (ACL) for RT-Thread
C
25
star
24

wavplayer

Minimal music player for wav file.
C
23
star
25

peripheral-sample

RT-Thread peripheral samples
C
22
star
26

cJSON

Ultralightweight JSON parser in ANSI C
C
21
star
27

jerryscript

JerryScript port for RT-Thread
C
18
star
28

samples

RT-Thread kernel and components samples.
C
18
star
29

bsal

蓝牙协议栈抽象层
C
16
star
30

vi

The screen-oriented text editor for RT-Thread.
C
16
star
31

SQLite

SQLite is a self-contained, high-reliability, embedded, full-featured, public-domain, SQL database engine.
C
15
star
32

coap

CoAP on RT-Thread
C
13
star
33

TJpgDec

a generic JPEG image decompressor module.
C
12
star
34

CMSIS

CMSIS(Cortex Microcontroller Software Interface Standard) package on RT-Thread
C
12
star
35

network-sample

RT-Thread network samples
C
11
star
36

aht10

digital humidity and temperature sensor AHT10 driver library
C
11
star
37

nopoll

ASPLes/nopoll - OpenSource WebSocket toolkit for RT-Thread
C
11
star
38

lv_demo_music

LVGL music player demo for RT-Thread | LVGL音乐播放器演示示例(RT-Thread定制版)
C
11
star
39

fastlz

lightning-fast compression library
C
10
star
40

nanopb

Protocol Buffers for Embedded Systems
C
9
star
41

rw007

RW007 (SPI Wi-Fi module) driver for RT-Thread
C
9
star
42

SEGGER_SystemView

SEGGER SystemView
C
9
star
43

CMSIS_RTOS2

RT-Thread操作系统的CMSIS-RTOS2兼容层 | CMSIS-RTOS2 Application Compatibility Layer (ACL) for RT-Thread
C
8
star
44

gt9147

gt9147 touch driver
C
8
star
45

infrared_framework

Infrared framework based on RT-Thread's pin,pwm and hwtimer driver.
C
8
star
46

stm32_sdio

STM32 SDIO peripheral universal driver library
C
8
star
47

filesystem-sample

RT-Thread filesystem samples
C
8
star
48

ulog_file

ulog file backend
C
8
star
49

onenet

China Mobile OneNet cloud SDK for RT-Thread
C
8
star
50

zlib

general purpose data compression library
C
7
star
51

joylink

Joylink Cloud SDK for IoT platform
C
7
star
52

bmi160_bmx160

The device driver package for BMX160 and BMI160.
C
7
star
53

LPM

逻辑分区管理(Logical partition management),支持动态创建、删除、查找、读写物理存储设备上的逻辑分区。
C
7
star
54

tlsf

TLSF is a dynamic memory allocation algorithm with predictable execution time and low fragmentation.
C
7
star
55

atsrv_socket

C
7
star
56

icm20608

a 3-axis gyroscope and a 3-axis accelerometer driver library. Compatible with MPU6050, MPU6500, MPUxxxx etc
C
6
star
57

wlan-wiced

wlan driver from WICED.
C
6
star
58

dstr

dynamic string in C
C
6
star
59

GAgent

GAgent of Gizwits in RT-Thread
C
6
star
60

vsensor

虚拟传感器
C
6
star
61

uffs

UFFS is a file system that uses NAND flash in a small memory environment
C
6
star
62

azure-iot-sdk

Microsoft azure cloud SDK for RT-Thread
C
6
star
63

lsm6dsl

This is the LSM6DSL sensor driver package, support: accelerometer, gyroscope, step.
C
6
star
64

rdb

RT-Thread Debug Bridge
C
5
star
65

logmgr

log system manager
C
5
star
66

jffs2

JFFS2 is a log file system implemented on MTD devices
C
5
star
67

ap3216c

digital ambient light and a proximity sensor ap3216c driver library
C
5
star
68

rti

RT-Thread insight, a probe tool for RT-Thread to help to analyze internal behavior of the system.
C
5
star
69

sht2x

digital humidity and temperature sensor SHT2x driver library
C
4
star
70

minimp3

MPEG Audio Layer III decoder from the FFmpeg libavcodec library.
C
4
star
71

iperf

iperf-liked network performance tool in RT-Thread.
C
4
star
72

event_recorder

A lightweight event record and replay tools for debug and test.
C
4
star
73

st7789

st7789 lcd driver
C
4
star
74

persimmon

Persimmon UI for RT-Thread.
C++
4
star
75

mlibc

mlibc - A small libc for MCU and RT-Thread
4
star
76

spl0601

The Digital Air Pressure Sensor SPL06-01 driver package.
C
4
star
77

bma400

This is the BMA400 sensor driver package, support: accelerometer, step.
C
3
star
78

kdb

kernel debug log tool
C
3
star
79

partition

A simple partition on block device.
C
3
star
80

ft6206

ft6206 touch driver
C
3
star
81

pcf8574

Remote 8-bit I/O expander for I2C-bus
C
3
star
82

kendryte_sdk

Kendryte K210 SDK
Python
3
star
83

ft6236

C
3
star
84

MultiButton

A compact and easy to use event-driven button driver module for RT-Thread. | 一个小巧易用的事件驱动按钮驱动模块.
C
3
star
85

libsodium-legacy

A modern and easy-to-use crypto library.
C
2
star
86

CMSIS_RTOS1

RT-Thread操作系统的CMSIS-RTOS1兼容层 | CMSIS-RTOS1 Application Compatibility Layer (ACL) for RT-Thread
C
2
star
87

jsmn

Jsmn is a world fastest JSON parser/tokenizer.
C
2
star
88

ezXML

An XML parser C library that's simple and easy to use.
C
2
star
89

pms

pms :power management system
2
star
90

trusted-firmware-m

ARM trusted-firmware-m porting for RT-Thread
Python
2
star
91

cairo

Multi-platform 2D graphics library
C
2
star
92

fdt

Device Tree package in RT-Thread
C
2
star
93

qianxun

C
2
star
94

gdbstub

gdbstub on RT-Thread
C
2
star
95

yaffs2

yaffs2 file system for RT-Thread
1
star
96

micro-ecc

micro-ecc package
Python
1
star
97

lsm303agr

This is the LSM303AGR sensor driver package, support: accelerometer, magnetometer.
C
1
star
98

duktape

Duktape - embeddable Javascript engine with a focus on portability and compact footprint, port for RT-Thread
1
star
99

player

Multi-Media Audio Stream Player for RT-Thread
1
star
100

snippets

Some code snippets for RT-Thread
Python
1
star