訊息串流
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
快速配對功能需要額外的管道,才能與供應商建立持續連線,以支援快速配對擴充功能。當提供者連線至支援的 Seeker 時,Seeker 會嘗試連線訊息串流。
支援的導入方式
Fast Pair 支援兩種訊息串流實作方式:
射頻接觸
使用固定 UUID 做為端點
df21fe2c-2515-4fdb-8886-f12c4d67927c
L2CAP
使用 GATT PSM 特性取得 L2CAP 連線的 PSM 值。
連線後,您可以使用以下格式交換訊息:
Octet |
資料類型 |
說明 |
是否必要? |
0 |
uint8 |
訊息群組 |
必填 |
1 |
uint8 |
訊息代碼 |
必填 |
2 到 3 |
uint16 |
額外資料長度 |
必填 |
4 - n |
|
額外資料 |
選用 |
其他資料長度和其他資料欄位應為大端序。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-13 (世界標準時間)。
[null,null,["上次更新時間:2025-08-13 (世界標準時間)。"],[[["\u003cp\u003eFast Pair utilizes a persistent connection with Providers via an additional channel to enable Fast Pair extensions.\u003c/p\u003e\n"],["\u003cp\u003eTwo message stream implementations are supported: RFCOMM using a fixed UUID and L2CAP using GATT PSM Characteristic for connection.\u003c/p\u003e\n"],["\u003cp\u003eExchanged messages adhere to a specific format containing message group, message code, additional data length, and optional additional data.\u003c/p\u003e\n"],["\u003cp\u003eData length and additional data fields within messages are represented in big endian format.\u003c/p\u003e\n"]]],[],null,["# Message Stream\n\nFast Pair requires an additional channel for a persistent connection with the\nProviders to support Fast Pair extensions. When the Provider connects to a\nsupported Seeker, the Seeker will attempt to connect the message stream.\n\nSupported Implementation\n------------------------\n\nFast Pair supports two kinds of message stream implementations:\n\n### RFCOMM\n\nUse fixed UUID as the endpoint\n`df21fe2c-2515-4fdb-8886-f12c4d67927c`\n\n### L2CAP\n\nUse GATT [PSM Characteristic](/nearby/fast-pair/specifications/bledevice#message_stream_PSM \"message stream_PSM\") to obtain the PSM value for L2CAP connection.\n\nMessage Format\n--------------\n\nOnce connected, messages can be exchanged in the following format:\n\n| Octet | Data Type | Description | Mandatory? |\n|-------|-----------|------------------------|------------|\n| 0 | uint8 | Message group | Mandatory |\n| 1 | uint8 | Message code | Mandatory |\n| 2 - 3 | uint16 | Additional data length | Mandatory |\n| 4 - n | | Additional data | Optional |\n\nThe additional data length and additional data fields should be big endian."]]