จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ผู้ให้บริการสามารถแจ้งข้อมูลอุปกรณ์แก่ผู้ค้นหาได้ผ่านสตรีมข้อความ
ชื่อกลุ่มข้อความ |
ค่า |
เหตุการณ์เกี่ยวกับข้อมูลอุปกรณ์ |
0x03 |
ชื่อรหัสข้อมูลอุปกรณ์ |
ค่า |
รหัสโมเดล |
0x01 |
อัปเดตที่อยู่ BLE แล้ว |
0x02 |
แบตเตอรี่อัปเดตแล้ว |
0x03 |
เวลาที่เหลือของแบตเตอรี่ |
0x04 |
คำขอคอมโพเนนต์ที่ใช้งานอยู่ |
0x05 |
การตอบสนองของคอมโพเนนต์ที่ใช้งานอยู่ |
0x06 |
(เลิกใช้งานแล้ว) ความสามารถ |
0x07 |
ประเภทแพลตฟอร์ม |
0x08 |
เวอร์ชันเฟิร์มแวร์ |
0x09 |
ตัวระบุชั่วคราวปัจจุบันของ FHN |
0x0B |
รหัสโมเดล
ข้อมูลรหัสรุ่น (สําหรับการเขียน AccountKey ย้อนหลัง) ควรส่งไปยัง Seeker เมื่อ RFCOMM เชื่อมต่อ เช่น 0x03010003AABBCC
จะมีลักษณะดังนี้
- 0x03: เหตุการณ์เกี่ยวกับข้อมูลอุปกรณ์
- 0x01: ค่ารหัสรุ่น
- 0x0003: ข้อมูลเพิ่มเติม ความยาว 3
- 0xAABBCC: ข้อมูลเพิ่มเติม รหัสรุ่น
ที่อยู่ BLE
ข้อมูลที่อยู่ BLE (สําหรับการเขียน AccountKey ย้อนหลัง) หากมี ควรส่งไปยังอุปกรณ์ค้นหาเมื่อ RFCOMM เชื่อมต่อและทุกครั้งที่มีการเปลี่ยนที่อยู่ เช่น 0x03020006AABBCCDDEEFF
จะเป็นดังนี้
- 0x03: เหตุการณ์เกี่ยวกับข้อมูลอุปกรณ์
- 0x02: ค่าที่อยู่ BLE
- 0x0006: ข้อมูลเพิ่มเติม ความยาว 6
- 0xAABBCCDDEEFF: ข้อมูลเพิ่มเติม ที่อยู่ BLE
อัปเดตแบตเตอรี่แล้ว
สำหรับผู้ให้บริการที่รองรับการแจ้งเตือนแบตเตอรี่ ระบบจะส่งข้อมูลแบตเตอรี่ผ่าน RFCOMM ได้ด้วย เมื่อ RFCOMM เชื่อมต่อหรือค่าแบตเตอรี่เปลี่ยนแปลง คุณควรส่งการอัปเดต ส่วนข้อมูลเพิ่มเติมของแพ็กเก็ตควรมีข้อมูลที่เหมือนกันกับไบต์ s + 2, s + 3, s + 4 เมื่อโฆษณาข้อมูลแบตเตอรี่ผ่าน BLE เช่น 0x0303000357417F
จะเป็น
- 0x03: เหตุการณ์เกี่ยวกับข้อมูลอุปกรณ์
- 0x03: ค่าแบตเตอรี่
- 0x0003: ข้อมูลเพิ่มเติม ความยาว 3
- 0x57417F: ข้อมูลเพิ่มเติม ค่าแบตเตอรี่
- 0x57: ค่าของหูฟังข้างซ้าย ไม่ชาร์จ แบตเตอรี่ 87%
- 0x41: ค่าของหูฟังข้างขวา ไม่ชาร์จ แบตเตอรี่ 65%
- 0x7F: ค่าเคส ไม่ชาร์จ แบตเตอรี่ไม่ทราบ
ผู้ให้บริการยังอัปเดตเวลาที่เหลือของแบตเตอรี่ได้ด้วย (หากทราบ) ตัวอย่างเช่น
0x03040001F0
จะเป็นค่าต่อไปนี้
- 0x03: เหตุการณ์เกี่ยวกับข้อมูลอุปกรณ์
- 0x04: เวลาที่เหลือของแบตเตอรี่
- 0x0001: ข้อมูลเพิ่มเติม ความยาว 1 (อาจเป็น 2 สำหรับ uint16 หากจำเป็น)
- 0xF0: ข้อมูลเพิ่มเติม เวลาที่เหลือของแบตเตอรี่เป็นนาที 240 นาที
คอมโพเนนต์ที่ใช้งานอยู่
ผู้ค้นหาอาจต้องการทราบว่าคอมโพเนนต์ใดที่ใช้งานอยู่ในปัจจุบัน ซึ่งหมายความว่าสามารถดําเนินการกับคอมโพเนนต์นั้นได้ (ดูการดำเนินการกับอุปกรณ์)
เมื่อผู้ให้บริการได้รับคำขอที่มีรหัสคำขอคอมโพเนนต์ที่ใช้งานอยู่ (0x05) ระบบควรแสดงการตอบกลับภายใน 1 วินาทีเพื่อระบุสถานะปัจจุบันของผู้ให้บริการ การตอบกลับจะใช้โค้ดการตอบกลับคอมโพเนนต์ที่ใช้งานอยู่ (0x06) และมีข้อมูลเพิ่มเติมที่ระบุคอมโพเนนต์ที่ใช้ได้
สําหรับผู้ให้บริการที่มีคอมโพเนนต์เดียว ควรตั้งค่าข้อมูลเพิ่มเติมเป็น 0x00 หากไม่มี ตัวอย่างเช่น โหมดพลังงานต่ำที่ระบบจะไม่เล่นสื่อ มิเช่นนั้น ให้ตั้งค่าข้อมูลเพิ่มเติมเป็น 0x01
สำหรับชุดหูฟังที่มีหลายองค์ประกอบ (เช่น หูฟังข้างซ้ายและขวา) แต่ละบิตในข้อมูลเพิ่มเติมจะแสดงว่าองค์ประกอบนั้นทำงานอยู่หรือไม่ ตัวอย่างของคอมโพเนนต์ที่ไม่มีการใช้งานอาจเป็นหูฟังที่อยู่ในเคสและไม่ได้ใช้งาน สำหรับเคสของหูฟังข้างซ้ายและขวาโดยเฉพาะ ให้ทำดังนี้
- 0x00 (0b00000000): ไม่มีหูฟังใดทำงานอยู่
- 0x01 (0b00000001): หูฟังเอียร์บัดข้างขวาทำงานอยู่ ส่วนข้างซ้ายไม่ทำงาน
- 0x02 (0b00000010): หูฟังเอียร์บัดซ้ายทำงานอยู่ ส่วนขวาไม่ทำงาน
- 0x03 (0b00000011): หูฟังเอียร์บัดทั้ง 2 ข้างทำงานอยู่
ผู้ให้บริการอาจต้องการดำเนินการแตกต่างกันไปตามแพลตฟอร์มที่เชื่อมต่ออยู่ ปัจจุบันการจับคู่ด่วนทำได้ผ่าน Android เท่านั้น แต่อาจรองรับอุปกรณ์อื่นๆ เพิ่มเติมในอนาคต
ข้อความจะมีไบต์แรกระบุประเภทแพลตฟอร์มในข้อมูลเพิ่มเติม ดังนี้
ชื่อแพลตฟอร์ม |
ค่า |
Android |
0x01 |
ระบบจะปรับแต่งไบต์ที่ 2 ตามแพลตฟอร์ม ใน Android ข้อมูลนี้จะหมายถึงเวอร์ชัน SDK ตัวอย่างเช่น Android Pie จะมีค่าเป็น 28 (0x1C)
เวอร์ชันเฟิร์มแวร์
เวอร์ชันเฟิร์มแวร์ของผู้ให้บริการเป็นสตริงที่เข้ารหัส UTF-8
ซึ่งเป็นข้อมูลเดียวกับในลักษณะการแก้ไขเฟิร์มแวร์
ตัวระบุชั่วคราวของ FHN ปัจจุบัน
ผู้ให้บริการที่โฆษณาเฟรม FHN ควรรายงานตัวระบุชั่วคราว (EID) ของ FHN ปัจจุบันพร้อมค่านาฬิกาปัจจุบันเพื่อซิงค์กับเครื่องมือค้นหาในกรณีที่นาฬิกาเดินช้า (เช่น เนื่องจากแบตเตอรี่หมด)
เช่น
- 0x03: เหตุการณ์เกี่ยวกับข้อมูลอุปกรณ์
- 0x0B: ข้อความตัวระบุชั่วคราวปัจจุบันของ FHN
- 0x0018: ข้อมูลเพิ่มเติม ความยาว 24 หรือ 36 ไบต์
- 0x13F9EA80: ข้อมูลเพิ่มเติม (ค่านาฬิกา 4 ไบต์)
- 0x1122334455667788990011223344556677889900: ข้อมูลเพิ่มเติม (EID ปัจจุบัน 20 หรือ 32 ไบต์)
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-13 UTC
[null,null,["อัปเดตล่าสุด 2025-08-13 UTC"],[[["\u003cp\u003eProviders can notify a Seeker about device information like Model ID, BLE address, battery status, and active components using a dedicated message stream.\u003c/p\u003e\n"],["\u003cp\u003eDevice information is communicated using specific event codes and additional data formats, allowing Seekers to understand the Provider's state.\u003c/p\u003e\n"],["\u003cp\u003eProviders can share details like platform type and firmware version for compatibility checks and tailored interactions.\u003c/p\u003e\n"],["\u003cp\u003eBattery information can be communicated using the Battery Updated event and include details such as battery level, charging status, and remaining time.\u003c/p\u003e\n"],["\u003cp\u003eActive components information helps Seekers to understand which device functionalities are available at the given time.\u003c/p\u003e\n"]]],[],null,["Device information\n------------------\n\nProviders can notify a Seeker about device information via the\n[message stream](#MessageStream).\n\n| Message Group Name | Value |\n|--------------------------|-------|\n| Device information event | 0x03 |\n\n| Device Information Code Name | Value |\n|----------------------------------|-------|\n| Model ID | 0x01 |\n| BLE address updated | 0x02 |\n| Battery updated | 0x03 |\n| Remaining battery time | 0x04 |\n| Active components request | 0x05 |\n| Active components response | 0x06 |\n| (Deprecated)Capabilities | 0x07 |\n| Platform type | 0x08 |\n| Firmware version | 0x09 |\n| Current FHN ephemeral identifier | 0x0B |\n\n### Model ID\n\nModel ID information (for\n[Retroactively Writing AccountKey](/nearby/fast-pair/specifications/extensions/retroactiveacctkey#RetroactivelyWritingAccountKey \"Retroactively Writing Account key\")) should be\nsent to the Seeker when RFCOMM connects. For example, `0x03010003AABBCC`\nwould be:\n\n- 0x03: Device information event\n- 0x01: Model ID value\n- 0x0003: Additional data, length 3\n- 0xAABBCC: Additional data, model ID\n\n### BLE address\n\nBLE address information (for\n[Retroactively Writing AccountKey](/nearby/fast-pair/specifications/extensions/retroactiveacctkey#RetroactivelyWritingAccountKey \"Retroactively Writing Account key\")) , if\navailable, should also be sent to the Seeker when RFCOMM connects and whenever\nthe address is rotated. For example, `0x03020006AABBCCDDEEFF` would be:\n\n- 0x03: Device information event\n- 0x02: BLE address value\n- 0x0006: Additional data, length 6\n- 0xAABBCCDDEEFF: Additional data, BLE address\n\n### Battery updated\n\nFor Providers that support [battery notifications](/nearby/fast-pair/specifications/extensions/batterynotification#BatteryNotification \"Battery Notification\"),\nbattery information can also be sent via RFCOMM. When RFCOMM connects or the\nbattery value changes, an update should be sent. The additional data section of\nthe packet should contain identical data to bytes *s + 2* , *s + 3* , *s + 4* when\nadvertising battery data over BLE. For example,`0x0303000357417F` would be:\n\n- 0x03: Device information event\n- 0x03: Battery value\n- 0x0003: Additional data, length 3\n- 0x57417F: Additional data, battery values\n - 0x57: Left bud value, not charging, 87% battery\n - 0x41: Right bud value, not charging, 65% battery\n - 0x7F: Case value, not charging, unknown battery\n\nProviders can also update remaining battery time (if known), For example,\n`0x03040001F0` would be:\n\n- 0x03: Device information event\n- 0x04: Remaining battery time\n- 0x0001: Additional data, length 1 (could be 2 for uint16 if needed.)\n- 0xF0: Additional data, remaining battery time in minutes, 240 minutes\n\n### Active components\n\nSeekers may sometimes desire to know which components are currently active,\nmeaning that an action can be taken on them (see [Device actions](/nearby/fast-pair/specifications/extensions/deviceaction#DeviceAction \"Message Stream: Device Actions\")).\nWhen the Provider receives a request containing the\n*active components request* code (0x05), a response should be returned within 1\nsecond indicating the Provider's current state. The response will use the\n*active components response* code (0x06) and contain additional data indicating\nwhich components are available.\n\nFor a Provider with a single component, the additional data should be set to\n0x00 if it is not available. An example of this might be a low power mode where\nmedia playback will not be performed. Otherwise, additional data should be set\nto 0x01.\n\nFor headsets with multiple components (for example, a left and right bud), each\nbit in the additional data represents whether that component is active. An\nexample of an inactive component might be a bud which is in the case and not in\nuse. Specifically for the left and right bud case:\n\n- 0x00 (0b00000000): Neither bud active\n- 0x01 (0b00000001): Right bud active, left inactive\n- 0x02 (0b00000010): Left bud active, right inactive\n- 0x03 (0b00000011): Both buds active\n\n### Platform Type\n\nProviders may want to perform differently based on the platform that they are\nconnected to. Fast Pair is currently only performed through Android, but support\nmay be expanded in the future.\n\nThe message will contain a first byte identifying platform type in the\nadditional data:\n\n| Platform Name | Value |\n|---------------|-------|\n| Android | 0x01 |\n\nThe second byte will be customized per platform. In Android, it will refer to the\n[SDK version](https://source.android.com/setup/start/build-numbers). For\nexample, Android Pie will have a value of 28 (0x1C).\n\n### Firmware version\n\nThe provider's firmware version as a string in utf-8 encoding.\nIt's the same information as in the [Firmware revision characteristic](/nearby/fast-pair/specifications/characteristics#FirmwareRevision \"Firmware revision characteristic\").\n\n### Current FHN Ephemeral Identifier\n\nProviders that advertise FHN frames should report the current FHN Ephemeral\nIdentifier (EID) with their current clock value to sync with the Seeker in case\nof a clock drift (for example, due to drained battery).\n\nFor example:\n\n- 0x03: Device information event\n- 0x0B: Current FHN ephemeral identifier message\n- 0x0018: Additional data, length 24 or 36 bytes\n- 0x13F9EA80: Additional data (clock value; 4 bytes)\n- 0x1122334455667788990011223344556677889900: Additional data (current EID; 20 or 32 bytes)"]]