Doc: Add Bluetooth basic documentation
Add basic Bluetooth documentation with sample.
Change-Id: I46077c8ee7e0ef464cda2374056fe061caaaee8b
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
diff --git a/doc/doxygen.config b/doc/doxygen.config
index 8441518..4c16c08 100644
--- a/doc/doxygen.config
+++ b/doc/doxygen.config
@@ -102,6 +102,7 @@
include/nanokernel/ \
kernel/microkernel/ \
kernel/nanokernel/ \
+ include/bluetooth/ \
INPUT_ENCODING = UTF-8
FILE_PATTERNS = "*.c" "*.h" "*.s"
RECURSIVE = YES
diff --git a/doc/index.rst b/doc/index.rst
index dfd9623..b2633a0 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -16,6 +16,7 @@
collaboration/collaboration.rst
development/index.rst
object/object.rst
+ net/network.rst
doxygen/doxygen.rst
diff --git a/doc/net/network.rst b/doc/net/network.rst
new file mode 100644
index 0000000..a54ce70
--- /dev/null
+++ b/doc/net/network.rst
@@ -0,0 +1,13 @@
+Network Documentation
+#####################
+
+The network documentation contains information regarding the network stack
+of the Zephyr Operating System. Use the information to understand the
+principles behind the operation of the stacks and how they were implemented.
+The following network stacks have been implemented:
+
+
+.. toctree::
+ :maxdepth: 2
+
+ network_bluetooth.rst
diff --git a/doc/net/network_bluetooth.rst b/doc/net/network_bluetooth.rst
new file mode 100644
index 0000000..220e214
--- /dev/null
+++ b/doc/net/network_bluetooth.rst
@@ -0,0 +1,75 @@
+.. _bluetooth:
+
+Bluetooth Implementation
+########################
+
+Initialization
+**************
+
+Initialize the Bluetooth subsystem using :c:func:`bt_init()`. Caller shall be
+either task or a fiber. Caller must ensure that function succeeds by checking
+return code for errors.
+
+Application Program Interfaces
+******************************
+
++------------------------------------------+------------------------------------------------------------+
+| Call | Description |
++==========================================+============================================================+
+| :c:func:`bt_init()` | Initializes the Bluetooth subsystem |
++------------------------------------------+------------------------------------------------------------+
+| :c:func:`bt_start_advertising()` | Set advertisement and scan data and start advertising |
++------------------------------------------+------------------------------------------------------------+
+
+TODO: Describe all API
+
+Bluetooth Application Example
+*****************************
+
+A simple Bluetooth beacon application is shown below. The application
+initializes a Bluetooth Subsystem and enables non-connectable advertising.
+It acts as a Bluetooth Low Energy broadcaster.
+
+.. literalinclude:: ../../samples/bluetooth/beacon/src/main.c
+ :language: c
+ :lines: 33-
+ :linenos:
+
+Testing with QEMU
+*****************
+
+A Bluetooth application might be tested with QEMU. In order to do so,
+a Bluetooth controller needs to be connected to the emulator.
+
+Using Host System Bluetooth Controller in QEMU
+==============================================
+
+The host system's Bluetooth controller is connected to the second QEMU
+serial line through a UNIX socket
+(QEMU option :literal:`-serial unix:/tmp/bt-server-bredr`).
+This option is already added to QEMU through :makevar:`QEMU_EXTRA_FLAGS`
+in the Makefile.
+
+On the Host side, BlueZ allows to "connect" Bluetooth controller through
+a so-called user channel.
+
+#. Use the btproxy tool to open the listening UNIX socket, type:
+
+ .. code-block:: console
+
+ $ sudo tools/btproxy -u
+ Listening on /tmp/bt-server-bredr
+
+ .. note:: Ensure that the Bluetooth controller is down before using the
+ btproxy command.
+
+
+#. To run application in the QEMU, type:
+
+ .. code-block:: console
+
+ $ make qemu
+
+Running QEMU now results in a connection with the second serial line to
+:literal:`bt-server-bredr` UNIX socket.
+Now, an application can use the Bluetooth device.