Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
/doc/nrf/libraries/bluetooth/mesh.rst @nrfconnect/ncs-paladin-doc
/doc/nrf/libraries/bluetooth/services/fast_pair/ @nrfconnect/ncs-si-bluebagel-doc
/doc/nrf/libraries/bluetooth/services/fast_pair.rst @nrfconnect/ncs-si-bluebagel-doc
/doc/nrf/libraries/bluetooth/services/wifi_prov.rst @nrfconnect/ncs-wifi-doc
/doc/nrf/libraries/bluetooth/services/wifi_prov_ble.rst @nrfconnect/ncs-wifi-doc
/doc/nrf/libraries/caf/ @nrfconnect/ncs-si-muffin-doc @nrfconnect/ncs-si-bluebagel-doc
/doc/nrf/libraries/debug/cpu_load.rst @nrfconnect/ncs-doc-leads
/doc/nrf/libraries/debug/etb_trace.rst @nrfconnect/ncs-cia-doc
Expand Down Expand Up @@ -173,6 +173,7 @@
/doc/nrf/libraries/networking/rest_client.rst @nrfconnect/ncs-iot-positioning-doc
/doc/nrf/libraries/networking/softap_wifi_provision.rst @nrfconnect/ncs-cia-doc
/doc/nrf/libraries/networking/wifi_mgmt_ext.rst @nrfconnect/ncs-cia-doc
/doc/nrf/libraries/networking/wifi_prov_*.rst @nrfconnect/ncs-cia-doc
/doc/nrf/libraries/networking/wifi_ready.rst @nrfconnect/ncs-wifi-doc
/doc/nrf/libraries/nfc/ @nrfconnect/ncs-si-muffin-doc
/doc/nrf/libraries/nrf_rpc/index.rst @nrfconnect/ncs-si-muffin-doc
Expand Down Expand Up @@ -540,6 +541,7 @@
/samples/tfm/ @nrfconnect/ncs-aegir
/samples/wifi/provisioning/ble/ @wentong-li @bama-nordic
/samples/wifi/provisioning/softap/ @nrfconnect/ncs-cia
/samples/wifi/provisioning/internal/ @krish2718 @rado17
/samples/wifi/radio_test/ @bama-nordic @sachinthegreen
/samples/wifi/scan/ @D-Triveni @bama-nordic
/samples/wifi/shell/ @nrfconnect/ncs-co-networking @krish2718 @sachinthegreen @rado17
Expand Down
3 changes: 2 additions & 1 deletion doc/_utils/redirects.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""
Copyright (c) 2022 Nordic Semiconductor
SPDX-License-Identifier: Apache-2.0
Expand Down Expand Up @@ -540,7 +540,8 @@
("libraries/bluetooth_services/services/nus_client", "libraries/bluetooth/services/nus_client"),
("libraries/bluetooth_services/services/rscs", "libraries/bluetooth/services/rscs"),
("libraries/bluetooth_services/services/throughput", "libraries/bluetooth/services/throughput"),
("libraries/bluetooth_services/services/wifi_prov", "libraries/bluetooth/services/wifi_prov"),
("libraries/bluetooth_services/services/wifi_prov", "libraries/bluetooth/services/wifi_prov_ble"),
("libraries/bluetooth/services/wifi_prov", "libraries/bluetooth/services/wifi_prov_ble"),
("libraries/networking/nrf_cloud_agps", "libraries/networking/nrf_cloud_agnss"), # nRF Cloud A-GNSS
("libraries/bootloader/index", "libraries/security/bootloader/index"), # Bootloader libraries (landing)
("libraries/bootloader/bl_crypto", "libraries/security/bootloader/bl_crypto"), # Bootloader crypto
Expand Down
119 changes: 119 additions & 0 deletions doc/nrf/libraries/bluetooth/services/wifi_prov_ble.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
.. _wifi_prov_readme:
.. _lib_wifi_prov_ble:

Wi-Fi provisioning Bluetooth LE transport
#########################################

.. contents::
:local:
:depth: 2

This library implements the Bluetooth® GATT transport layer for the Wi-Fi® provisioning service.
It provides the Bluetooth LE-specific implementation of the transport interface defined by the core Wi-Fi provisioning library.
The Bluetooth LE transport layer is designed to work with the core Wi-Fi provisioning library located at :file:`subsys/net/lib/wifi_prov/` directory.

Overview
********

The Bluetooth LE transport layer is responsible for:

* GATT service interface - Defines the GATT service and serves as the transport layer for the provisioning protocol.
* Bluetooth LE-specific message handling - Implements the transport functions required by the core library.
* Connection management - Manages Bluetooth LE connections and handles characteristic notifications and indications.

Configuration
*************

To use this library, enable the :kconfig:option:`CONFIG_BT_WIFI_PROV` Kconfig option.

Service declaration
*******************

The Wi-Fi Provisioning Service is instantiated as a primary service.
Set the service UUID value as defined in the following table:

========================== ========================================
Service name UUID
Wi-Fi Provisioning Service ``14387800-130c-49e7-b877-2881c89cb258``
========================== ========================================

Service characteristics
=======================

The UUID value of characteristics are defined in the following table.

========================== ========================================
Characteristic name UUID
Information ``14387801-130c-49e7-b877-2881c89cb258``
Operation Control Point ``14387802-130c-49e7-b877-2881c89cb258``
Data Out ``14387803-130c-49e7-b877-2881c89cb258``
========================== ========================================

The characteristic requirements of the Wi-Fi Provisioning Service are shown in the following table.

+-----------------+-------------+-------------+-------------+-------------+
| Characteristic | Requirement | Mandatory | Optional | Security |
| name | | properties | properties | permissions |
+=================+=============+=============+=============+=============+
| Information | Mandatory | Read | | No security |
| | | | | required |
+-----------------+-------------+-------------+-------------+-------------+
| Operation | Mandatory | Indicate, | | Encryption |
| Control | | Write | | required |
| Point | | | | |
+-----------------+-------------+-------------+-------------+-------------+
| Operation | Mandatory | Read, Write | | Encryption |
| Control | | | | required |
| Point | | | | |
| - Client | | | | |
| Characteristic | | | | |
| Configuration | | | | |
| descriptor | | | | |
+-----------------+-------------+-------------+-------------+-------------+
| Data Out | Mandatory | Notify | | Encryption |
| | | | | required |
+-----------------+-------------+-------------+-------------+-------------+
| Data Out | Mandatory | Read, Write | | Encryption |
| - Client | | | | required |
| Characteristic | | | | |
| Configuration | | | | |
| descriptor | | | | |
+-----------------+-------------+-------------+-------------+-------------+

The purpose of each characteristic is as follows:

* ``Information`` - For client to get ``Info`` message from server.
* ``Operation Control Point`` - For client to send ``Request`` message to server, and server to send ``Response`` message to client.
* ``Data Out`` - For server to send ``Result`` message to the client.

Transport interface implementation
**********************************

The Bluetooth LE transport layer implements the transport interface defined by the core Wi-Fi provisioning library:

* :c:func:`wifi_prov_send_rsp` - Sends Response messages through Bluetooth LE indications on the Operation Control Point characteristic.
* :c:func:`wifi_prov_send_result` - Sends Result messages through Bluetooth LE notifications on the Data Out characteristic.

The transport layer also handles:

* Receiving request messages from the Operation Control Point characteristic.
* Providing info messages through the Information characteristic.
* Managing Bluetooth LE connection state and characteristic subscriptions.

Dependencies
************

The Bluetooth LE transport layer depends on:

* :ref:`lib_wifi_prov_core`
* Bluetooth stack (:kconfig:option:`CONFIG_BT`)
* nanopb for protobuf message handling


API documentation
*****************

| Header file: :file:`include/net/wifi_prov_core/wifi_prov_core.h`
| Source files: :file:`subsys/bluetooth/services/wifi_prov`

.. doxygengroup:: bt_wifi_prov
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
.. _wifi_prov_readme:
.. _lib_wifi_prov_core:

Wi-Fi Provisioning Service
##########################
Wi-Fi Provisioning Core
#######################

.. contents::
:local:
:depth: 2

This library implements a Bluetooth® GATT service for Wi-Fi® provisioning.
It is an implementation of the server side of the Wi-Fi provisioning protocol defined by Nordic Semiconductor.
It is to be used with the :ref:`wifi_provisioning` sample.
The Wi-Fi Provisioning Service forms a complete reference solution, together with the mobile application.
For details, see the :ref:`wifi_provisioning` sample documentation.
This library implements the core Wi-Fi® provisioning functionality that is transport-agnostic.
It provides protocol implementation, message handling, and configuration management for Wi-Fi provisioning.
The core library is designed to work with various transport layers (For example, Bluetooth® LE, Wi-Fi SoftAP) through a defined transport interface.

Overview
********

The service is divided into three parts:
The core library is responsible for:

* GATT service interface: Defines the GATT service and serves as the transport layer for the provisioning protocol.
* Task and event handling component: Implements the provisioning protocol.
* Configuration management component: Manages the provisioning data (in RAM and flash) accessed by multiple threads.
* Protocol implementation - Implements the Wi-Fi provisioning protocol using Protocol Buffers.
* Message handling - Processes Request messages and generates Response/Result messages.
* Configuration management - Manages Wi-Fi configurations in RAM and flash.
* Transport interface - Provides weak transport functions that can be overridden by transport layers.

.. _wifi_provisioning_protocol:

Expand Down Expand Up @@ -109,7 +108,7 @@ The protocol defines four message types:
=================== ======================= ======================== =======================================================================================

These definitions are available as :file:`.proto` files in the library path.
See all definitions in the :file:`subsys/bluetooth/services/wifi_prov/proto/` folder.
See all definitions in the :file:`subsys/net/lib/wifi_prov/proto/` folder.

Workflow
========
Expand Down Expand Up @@ -163,76 +162,15 @@ In the ``Response`` message, the ``request_op_code`` is ``FORGET_CONFIG``, and t

When the connection state changes or an attempt fails, the target will set up a ``Result`` message, and the ``state`` field indicates the current state of the Wi-Fi, and the ``reason`` field indicates the failure reason.

Service declaration
Transport interface
*******************

The Wi-Fi Provisioning Service is instantiated as a primary service.
Set the service UUID value as defined in the following table.

========================== ========================================
Service name UUID
Wi-Fi Provisioning Service ``14387800-130c-49e7-b877-2881c89cb258``
========================== ========================================

Service characteristics
=======================

The UUID value of characteristics are defined in the following table.

========================== ========================================
Characteristic name UUID
Information ``14387801-130c-49e7-b877-2881c89cb258``
Operation Control Point ``14387802-130c-49e7-b877-2881c89cb258``
Data Out ``14387803-130c-49e7-b877-2881c89cb258``
========================== ========================================

The characteristic requirements of the Wi-Fi Provisioning Service are shown in the following table.

+-----------------+-------------+-------------+-------------+-------------+
| Characteristic | Requirement | Mandatory | Optional | Security |
| name | | properties | properties | permissions |
+=================+=============+=============+=============+=============+
| Information | Mandatory | Read | | No security |
| | | | | required |
+-----------------+-------------+-------------+-------------+-------------+
| Operation | Mandatory | Indicate, | | Encryption |
| Control | | Write | | required |
| Point | | | | |
+-----------------+-------------+-------------+-------------+-------------+
| Operation | Mandatory | Read, Write | | Encryption |
| Control | | | | required |
| Point | | | | |
| - Client | | | | |
| Characteristic | | | | |
| Configuration | | | | |
| descriptor | | | | |
+-----------------+-------------+-------------+-------------+-------------+
| Data Out | Mandatory | Notify | | Encryption |
| | | | | required |
+-----------------+-------------+-------------+-------------+-------------+
| Data Out | Mandatory | Read, Write | | Encryption |
| - Client | | | | required |
| Characteristic | | | | |
| Configuration | | | | |
| descriptor | | | | |
+-----------------+-------------+-------------+-------------+-------------+

The purpose of each characteristic is as follows:

* ``Information``: For client to get ``Info`` message from server.
* ``Operation Control Point``: For client to send ``Request`` message to server, and server to send ``Response`` message to client.
* ``Data Out``: For server to send ``Result`` message to the client.

It takes the functions exposed by the task and event handling part of reading the ``Info`` message and receiving the ``Request`` message as the callbacks of corresponding characteristics.
It provides functions for the task and event handling part to send ``Response`` and ``Result`` messages.

Task and event handling
***********************

The service uses `nanopb`_ to instantiate the protocol buffers-based, platform-independent messages in the C language.

It exposes the functions of reading the ``Info`` message and receiving the ``Request`` message to transport layer.
It uses the function of sending ``Response`` and ``Result`` messages provided by the transport layer to send these messages.
The core library provides a transport-agnostic interface through weak functions that can be overridden by transport layers:

* :c:func:`wifi_prov_send_rsp` - Sends Response messages to the transport layer
* :c:func:`wifi_prov_send_result` - Sends Result messages to the transport layer

Transport layers must implement these functions to handle the actual message transmission (for example, Bluetooth LE indications and notifications, USB transfers, UART transmissions).

Configuration management
************************
Expand All @@ -243,10 +181,19 @@ The component has one slot in RAM to save the configurations.

You can save the configuration in flash or RAM during provisioning.

Dependencies
************

The core library depends on:

* nanopb for protobuf message handling.
* Wi-Fi credentials library for configuration management (:ref:`lib_wifi_credentials`).
* Wi-Fi management interface for network operations (:ref:`wifi_mgmt`).

API documentation
*****************

| Header file: :file:`include/bluetooth/services/wifi_provisioning.h`
| Source files: :file:`subsys/bluetooth/services/wifi_prov`
| Header file: :file:`include/net/wifi_prov_core/wifi_prov_core.h`
| Source files: :file:`subsys/net/lib/wifi_prov_core`

.. doxygengroup:: bt_wifi_prov
.. doxygengroup:: wifi_prov_core
Loading