index.rst 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. BLE User Guide
  2. ----------------
  3. Apache Mynewt offers the world's first fully open-source Bluetooth Low
  4. Energy (BLE) or Bluetooth Smart stack fully compliant with Bluetooth 5
  5. specifications with support for Bluetooth Mesh. It is called NimBLE.
  6. BLE technology operates in the unlicensed industrial, scientific and
  7. medical (ISM) band at 2.4 to 2.485 GHz which is available in most
  8. countries. It uses a spread spectrum, frequency hopping, full-duplex
  9. signal. BLE FHSS employs 40 2-MHz-wide channels to ensure greater
  10. reliability over longer distances. It also features 0-dBm (1 mW) power
  11. output and a typical maximum range of 50 meters. With Bluetooth 5
  12. specification range can be increased 4 times and speed 2 time.
  13. .. toctree::
  14. :hidden:
  15. :titlesonly:
  16. ble_sec
  17. ble_setup/ble_setup_intro
  18. ble_hs/ble_hs
  19. btshell Usage API <btshell/btshell_api>
  20. mesh/index
  21. .. contents::
  22. :local:
  23. :depth: 2
  24. Note that BLE is not compatible with standard Bluetooth.
  25. Features
  26. ~~~~~~~~
  27. NimBLE complies with Bluetooth Core Specification 5.0 which makes it an
  28. ideal wireless technology for the Internet of Things (IoT).
  29. - LE Advertising Extensions
  30. - 2Msym/s PHY for higher throughput
  31. - Coded PHY for LE Long Range
  32. - High Duty Cycle Non-Connectable Advertising
  33. - Channel Selection Algorithm #2 to utilize channels in more efficient
  34. way.
  35. - LE Privacy 1.2 for frequent changes to the device address to make it
  36. difficult to track for outsiders
  37. - LE Secure Connections featuring FIPS-compliant algorithms.
  38. - LE Data Length Extension for higher throughput
  39. - **Coming Soon**: Assigning an Internet Protocol (IP) address
  40. (compliant with the IPv6 or 6LoWPAN standard) to a Bluetooth device
  41. through Internet Protocol Support Profile (IPSP)
  42. The Bluetooth 5 is backward compatible with previous Bluetooth version
  43. 4.2 which is also supported by Apache Mynewt.
  44. Bluetooth Mesh features
  45. ~~~~~~~~~~~~~~~~~~~~~~~
  46. Bluetooth Mesh is a great addition to and opens a wide range of new
  47. possibilities for the IoT connectivity space. NimBLE fully supports the
  48. following Bluetooth Mesh features:
  49. - Advertising and GATT bearers
  50. - PB-GATT and PB-ADV provisioning
  51. - Foundation Models (server role)
  52. - Relay support
  53. - GATT Proxy
  54. Components
  55. ~~~~~~~~~~
  56. A Bluetooth low energy stack (NimBLE included) consists of two
  57. components with several subcomponents:
  58. - **Controller**
  59. - **Physical Layer**: adaptive frequency-hopping Gaussian Frequency
  60. Shift Keying (GFSK) radio using 40 RF channels (0-39), with 2 MHz
  61. spacing.
  62. - **Link Layer**: with one of five states (Standby, Advertising,
  63. Scanning, Initiating, Connection states) active at any time
  64. - **Host**
  65. - **Logical Link Control and Adaptation Protocol (L2CAP)**: provides
  66. logical channels, named L2CAP channels, which are multiplexed over
  67. one or more logical links to provide packet segmentation and
  68. reassembly, flow control, error control, streaming, QoS etc.
  69. - **Security Manager (SM)**: uses Security Manager Protocol (SMP)
  70. for pairing and transport specific key distribution for securing
  71. radio communication
  72. - **Attribute protocol (ATT)**: allows a device (*Server*) to expose
  73. certain pieces of data, known as *Attributes*, to another device
  74. (*Client*)
  75. - **Generic Attribute Profile (GATT)**: a framework for using the
  76. ATT protocol to exchange attributes encapsulated as
  77. *Characteristics* or *Services*
  78. - **Generic Access Profile (GAP)**: a base profile which all
  79. Bluetooth devices implement, which in the case of LE, defines the
  80. Physical Layer, Link Layer, L2CAP, Security Manager, Attribute
  81. Protocol and Generic Attribute Profile.
  82. - **Host Controller Interface (HCI)**: the interface between the
  83. host and controller either through software API or by a hardware
  84. interface such as SPI, UART or USB.
  85. Subsequent chapters in this manual will go into the details of the
  86. implementation of each component, APIs available, and things to consider
  87. while designing a NimBLE app.
  88. Example NimBLE projects
  89. ~~~~~~~~~~~~~~~~~~~~~~~
  90. Mynewt comes with two built-in projects that allow users to play with
  91. NimBLE, try the tutorials out with, and see how to use available
  92. services.
  93. 1. **btshell** : A simple shell application which provides a basic
  94. interface to the host-side of the BLE stack.
  95. 2. **bleprph**: A basic peripheral device with no user interface. It
  96. advertises automatically on startup, and resumes advertising whenever
  97. a connection is terminated. It supports a maximum of one connection.
  98. 3. **blemesh**: A sample application for Bluetooth Mesh Node using
  99. on/off model.