Google Fast Pair Service (GFPS)
The Google Fast Pair Service (Fast Pair for short) implements a Bluetooth® LE GATT Service required when Using Google Fast Pair with the nRF Connect SDK.
The Fast Pair service uses UUID of
The Fast Pair GATT characteristics are described in detail in the Fast Pair GATT Characteristics documentation. The implementaion available in the nRF Connect SDK follows these requirements.
The Additional Data characteristic is not supported yet.
CONFIG_BT_FAST_PAIR to enable the module.
The following Kconfig options are also available for this module:
CONFIG_BT_FAST_PAIR_STORAGE_ACCOUNT_KEY_MAX- The option configures maximum number of stored Account Keys.
CONFIG_BT_FAST_PAIR_CRYPTO_MBEDTLS- These options are used to select cryptographic backend for Fast Pair. MbedTLS is used by default, whereas Tinycrypt is used by default for cases of building with TF-M as the Secure Execution Environment (
CONFIG_BUILD_WITH_TFM). This is because in such case the MbedTLS API cannot be directly used by the Fast Pair service.
See the Kconfig help for details.
To simplify the configuration process, the GFPS modifies the default values of related Kconfig options to meet the Fast Pair requirements. The service also enables some of the functionalities using Kconfig select statement.
During not discoverable advertising, the Resolvable Private Address (RPA) rotation must be done together with the Fast Pair payload update. Because of this, the RPA cannot be rotated by Zephyr in the background.
During discoverable advertising session, the Resolvable Private Address (RPA) rotation must not happen. Therefore, consider the following points:
Bluetooth Security Manager Protocol (SMP)
The service selects
The Fast Pair specification requires support for Bluetooth LE pairing.
During an ongoing Fast Pair procedure, peers using a normal Bluetooth LE bonding procedures are rejected by the service to prevent reporting invalid bonding capabilities.
Firmware Revision characteristic
The Fast Pair specification requires enabling GATT Device Information Service and the Firmware Revision characteristic.
For this reason, the default values of
CONFIG_BT_DIS_FW_REV, respectively, are set to enabled.
The default value of
CONFIG_BT_DIS_FW_REV_STR is set to
CONFIG_BOOTLOADER_MCUBOOT is enabled.
Otherwise, it is set to
The Fast Pair specification suggests using ATT maximum transmission unit (MTU) value of
83 if possible.
Because of this requirement, the default values of the following Kconfig options are modified by the GFPS Kconfig:
In case of nRF53 Series, this part of the configuration cannot be automatically updated for the network core and you must manually align it. The listed options must be set on the network core to default values specified by the GFPS Kconfig options.
The implementation uses
BT_GATT_SERVICE_DEFINE to statically define and register the Fast Pair GATT service.
The Fast Pair service automatically handles all of the requests received from the Fast Pair Seeker.
No application input is required to handle the requests.
The Fast Pair service overrides the set of Zephyr’s Bluetooth authentication callbacks (
bt_conn_auth_cb) while handling Key-Based Pairing request.
The callbacks are updated to report proper device capabilities for Bluetooth LE pairing request/response packets.
Overriding callbacks allows the GFPS to take over Bluetooth authentication during Fast Pair Procedure and perform all of the required operations without interacting with the application.
After the procedure is finished, the previously used callbacks are assigned back.
The Fast Pair Provider can still bond using a normal Bluetooth LE bonding procedures, without using Fast Pair. The normal Bluetooth LE bonding procedure can be used, for example, if the connected Bluetooth Central does not support Fast Pair. In that case, the bonding uses Bluetooth authentication callbacks registered by the application.
Zephyr supports only one set of Bluetooth authentication callbacks. Because of this limitation, it is not possible to simultaneously handle bonding using Fast Pair procedure and normal Bluetooth LE bonding. In that case improper device capabilities would be reported.
Make sure that the normal Bluetooth LE bonding procedure and Fast Pair procedure do no overlap with each other. The recommended approach is to avoid handling more than one bonding procedure at a time.
- group bt_fast_pair
Fast Pair API.
Fast Pair advertising mode. Used to generate advertising packet.
Fast Pair discoverable advertising.
Fast Pair not discoverable advertising, show UI indication.
Fast Pair not discoverable advertising, hide UI indication.
Number of Fast Pair advertising modes.
- enumerator BT_FAST_PAIR_ADV_MODE_DISCOVERABLE
size_t bt_fast_pair_adv_data_size(enum bt_fast_pair_adv_mode fp_adv_mode)
Get Fast Pair advertising data buffer size.
fp_adv_mode – [in] Fast Pair advertising mode.
Fast Pair advertising data buffer size in bytes if the operation was successful. Otherwise zero is returned.
int bt_fast_pair_adv_data_fill(struct bt_data *adv_data, uint8_t *buf, size_t buf_size, enum bt_fast_pair_adv_mode fp_adv_mode)
Fill Bluetooth advertising packet with Fast Pair advertising data.
Provided buffer will be used in bt_data structure. The data must be valid while the structure is in use.
The buffer size must be at least bt_fast_pair_adv_data_size. Caller shall also make sure that Account Key write from a connected Fast Pair Seeker would not preempt generating Fast Pair not discoverable advertising data. To achieve this, this function and bt_fast_pair_adv_data_size should be called from context with cooperative priority.
adv_data – [out] Pointer to the Bluetooth advertising data structure to be filled.
buf – [out] Pointer to the buffer used to store Fast Pair advertising data.
buf_size – [in] Size of the buffer used to store Fast Pair advertising data.
fp_adv_mode – [in] Fast Pair advertising mode. According to Fast Pair specification, when no Account Key has been saved on the device both Fast Pair not discoverable advertising modes result in the same advertising data.
0 if the operation was successful. Otherwise, a (negative) error code is returned.
void bt_fast_pair_set_pairing_mode(bool pairing_mode)
Enable or disable Fast Pair pairing mode.
Pairing mode must be enabled if discoverable Fast Pair advertising is used. Pairing mode must be disabled if not discoverable Fast Pair advertising is used.
It is user responsibility to make sure that proper pairing mode is used before advertising is started. Fast Pair pairing mode is enabled by default.
pairing_mode – [in] Boolean indicating if device is in pairing mode.
- enum bt_fast_pair_adv_mode