消息流
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
快速配对需要额外的通道才能与提供程序建立持久连接,以支持快速配对扩展程序。当提供程序连接到受支持的 Seeker 时,Seeker 会尝试连接消息流。
支持的实现方式
快速配对支持两种消息流实现:
RFCOMM
使用固定的 UUID 作为端点
df21fe2c-2515-4fdb-8886-f12c4d67927c
L2CAP
使用 GATT PSM 特征获取 L2CAP 连接的 PSM 值。
连接后,您可以使用以下格式交换消息:
Octet |
数据类型 |
说明 |
是否必需? |
0 |
uint8 |
消息群组 |
强制 |
1 |
uint8 |
邮件内容代码 |
强制 |
2 - 3 人 |
uint16 |
其他数据长度 |
强制 |
4 - n |
|
附加数据 |
可选 |
额外数据长度和额外数据字段应采用大端序。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-13。
[null,null,["最后更新时间 (UTC):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."]]