Using Google Fast Pair with the nRF Connect SDK
Google Fast Pair is a standard for pairing Bluetooth® and Bluetooth Low Energy (LE) devices with as little user interaction required as possible. Google also provides additional features built upon the Fast Pair standard. For detailed information about supported functionalities, see the official Fast Pair documentation.
The Fast Pair support in the nRF Connect SDK is experimental. The implementation is not yet ready for production and extensions are not fully supported.
The implementation passes Fast Pair Validator (beta version) tests. The procedure triggered in Android settings is successful (tested with Android 11).
The Fast Pair standard integration in the nRF Connect SDK consists of the following steps:
These steps are described in the following sections.
A device model must be registered with Google to work as a Fast Pair Provider. The data is used for procedures defined by the Fast Pair standard.
See the official Fast Pair Model Registration documentation for information on how to register the device and obtain the Model ID and Anti-Spoofing Public/Private Key pair. Alternatively, you can use the debug Model ID and Anti-Spoofing Public/Private Key pair obtained by Nordic Semiconductor for the development purposes. See the Bluetooth: Fast Pair sample and the nRF Desktop for details about the debug Fast Pair Providers registered by Nordic.
The Fast Pair standard requires provisioning the device with Model ID and Anti-Spoofing Private Key obtained during device model registration. In the nRF Connect SDK, the provisioning data is generated as a hexadecimal file using the Fast Pair provision script.
If Fast Pair is enabled with the
CONFIG_BT_FAST_PAIR Kconfig option, the Fast Pair provision script is called automatically by the build system and the resulting hexadecimal file is automatically added to the firmware (that is, to the
You must provide the following CMake options:
FP_MODEL_ID- Fast Pair Model ID in format
FP_ANTI_SPOOFING_KEY- base64-encoded Fast Pair Anti-Spoofing Private Key.
bt_fast_pair partition address is provided automatically by the build system.
For example, when building an application with the nRF Connect for VS Code extension, you need to add the following parameters in the Extra CMake arguments field on the Add Build Configuration view:
Make sure to replace
AbAbAbAbAbAbAbAbAbAbAbAbAbAbAbAbAbAbAbAbAbA= with values obtained for your device.
See Providing CMake options for more information about defining CMake options.
The Fast Pair Provider must include Fast Pair service advertising data in the advertising payload. The Fast Pair Seeker must also know the Provider’s transmit power to determine proximity.
The Fast Pair service implementation provides API to generate the advertising data for both discoverable and not discoverable advertising:
These functions are used to check the buffer size required for the advertising data and fill the buffer with data. Managing memory used for the advertising packets is a responsibility of the application. Make sure that these functions are called by the application from the cooperative context to ensure that not discoverable advertising data generation is not preempted by an Account Key write operation from a connected Fast Pair Seeker. Account Keys are used to generate not discoverable advertising data. Special battery data can be included in not discoverable advertising packet using the Fast Pair Battery Notification extension. To use this extension, ensure the following:
bt_fast_pair_battery_set()to provide battery information.
BT_FAST_PAIR_ADV_BATTERY_MODE_HIDE_UI_INDto include the battery notification in the generated advertising payload.
See the Fast Pair Battery Notification extension documentation for more details about this extension.
This function is to be used to set pairing mode before the advertising is started.
Since you control the advertising, make sure to use advertising parameters consistent with the specification. The Bluetooth privacy is selected by the Fast Pair service, but you must make sure that the following requirements are met:
The Resolvable Private Address (RPA) rotation is synchronized with the advertising payload update during the not discoverable advertising.
The Resolvable Private Address (RPA) address is not rotated during discoverable advertising session.
See the official Fast Pair Advertising documentation for detailed information about the requirements related to discoverable and not discoverable advertising.
The Fast Pair advertising data provider (
CONFIG_BT_ADV_PROV_FAST_PAIR) can be used to manage the Fast Pair advertising data.
See Bluetooth: Fast Pair for an example of using the provider in a sample.
subsys/bluetooth/adv_prov/providers/fast_pair.c for provider implementation.
The Fast Pair Seeker must know the TX power of the Provider to determine proximity. The TX power can be provided in one of the following ways:
Defined during model registration
Included in the advertising payload
See the Fast Pair TX power documentation for more information.
Advertising data provider
If your application uses Bluetooth LE advertising providers, you can use the TX power advertising data provider (
CONFIG_BT_ADV_PROV_TX_POWER) to read the advertising TX power from Bluetooth controller and add it to the generated advertising data.
CONFIG_BT_ADV_PROV_TX_POWER_CORRECTION_VAL option can be used to define a TX power correction value that is added to the TX power readout included in the advertising data.
The option can be used to take into account hardware configuration, for example, used antenna and device casing.
See Bluetooth: Fast Pair sample for an example of how to use the TX power advertising provider.
Multiprotocol Service Layer front-end module (MPSL FEM)
If your application uses MPSL Front-end module feature, you can use a front-end module power model. The power model allows you to control the TX power more accurately and compensate, for example, for external conditions. See the TX power split using models section of the Front-end module feature documentation for more details. See the MPSL FEM power model section in API documentation for API documentation.
The Fast Pair GATT service is implemented by the Google Fast Pair Service (GFPS). The service implements functionalities required by the Fast Pair Procedure. The procedure is initiated by the Fast Pair Seeker after Bluetooth LE connection is established. No application interaction is required.
The Fast Pair GATT service modifies default values of related Kconfig options to follow Fast Pair requirements. The service also enables the needed functionalities using Kconfig select statement. For details, see the Google Fast Pair Service (GFPS) Bluetooth service documentation in the nRF Connect SDK.
The Fast Pair GATT service uses a non-volatile memory to store the Fast Pair user data such as Account Keys and the Personalized Name.
This data can be cleared by calling the
For details, see the
bt_fast_pair_factory_reset() function documentation.
You can also use the
CONFIG_BT_FAST_PAIR_STORAGE_USER_RESET_ACTION Kconfig option to enable a custom user reset action that executes together with this factory reset operation.