สตรีมข้อความ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
การจับคู่ด่วนต้องใช้ช่องทางเพิ่มเติมสำหรับการเชื่อมต่อกับผู้ให้บริการแบบถาวรเพื่อรองรับส่วนขยายการจับคู่ด่วน เมื่อผู้ให้บริการเชื่อมต่อกับเครื่องมือค้นหาที่รองรับ เครื่องมือค้นหาจะพยายามเชื่อมต่อสตรีมข้อความ
การใช้งานที่รองรับ
การจับคู่ด่วนรองรับการใช้งานสตรีมข้อความ 2 ประเภท ได้แก่
RFCOMM
ใช้ UUID แบบคงที่เป็นปลายทาง
df21fe2c-2515-4fdb-8886-f12c4d67927c
L2CAP
ใช้ ลักษณะ PSM ของ GATT เพื่อรับค่า PSM สำหรับการเชื่อมต่อ L2CAP
เมื่อเชื่อมต่อแล้ว คุณจะแลกเปลี่ยนข้อความในรูปแบบต่อไปนี้ได้
อ็อกเท็ต |
ประเภทข้อมูล |
คำอธิบาย |
ต้องระบุหรือไม่ |
0 |
uint8 |
กลุ่มข้อความ |
บังคับ |
1 |
uint8 |
รหัสข้อความ |
บังคับ |
2 - 3 |
uint16 |
ความยาวของข้อมูลเพิ่มเติม |
บังคับ |
4 - n |
|
ข้อมูลเพิ่มเติม |
ไม่บังคับ |
ความยาวของข้อมูลเพิ่มเติมและช่องข้อมูลเพิ่มเติมควรเป็น Big Endian
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-13 UTC
[null,null,["อัปเดตล่าสุด 2025-08-13 UTC"],[[["\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."]]