透過集合功能整理內容
你可以依據偏好儲存及分類內容。
供應商可以透過訊息串流通知尋找者裝置資訊。
裝置資訊代碼名稱 |
值 |
模型 ID |
0x01 |
已更新 BLE 位址 |
0x02 |
電池更新 |
0x03 |
剩餘電量時間 |
0x04 |
有效元件要求 |
0x05 |
有效元件回應 |
0x06 |
(已淘汰) 功能 |
0x07 |
平台類型 |
0x08 |
韌體版本 |
0x09 |
目前的 FHN 暫時 ID |
0x0B |
模型 ID
在 RFCOMM 連線時,應將模型 ID 資訊 (用於回溯寫入 AccountKey) 傳送至 Seeker。例如 0x03010003AABBCC
會是:
- 0x03:裝置資訊事件
- 0x01:型號 ID 值
- 0x0003:額外資料,長度為 3
- 0xAABBCC:其他資料、型號 ID
BLE 位址
BLE 位址資訊 (用於事後寫入 AccountKey) 如有,也應在 RFCOMM 連線時和每次輪替位址時傳送至 Seeker。例如 0x03020006AABBCCDDEEFF
:
- 0x03:裝置資訊事件
- 0x02:BLE 位址值
- 0x0006:額外資料,長度為 6
- 0xAABBCCDDEEFF:其他資料、BLE 位址
電池更新
對於支援電池通知的供應商,也可以透過 RFCOMM 傳送電池資訊。當 RFCOMM 連線或電池值變更時,應傳送更新。透過 BLE 宣傳電池資料時,封包的額外資料部分應包含與位元組 s + 2、s + 3、s + 4 相同的資料。例如,0x0303000357417F
會是:
- 0x03:裝置資訊事件
- 0x03:電池值
- 0x0003:額外資料,長度為 3
- 0x57417F:其他資料、電池值
- 0x57:左側耳機值,未充電,電量 87%
- 0x41:右側耳機值,未充電,電量 65%
- 0x7F:裝置在充電盒中,未充電,電池不明
供應商也可以更新剩餘電力時間 (如果已知)。例如,0x03040001F0
會是:
- 0x03:裝置資訊事件
- 0x04:剩餘電量
- 0x0001:額外資料,長度為 1 (如有需要,可為 uint16 的 2)。
- 0xF0:額外資料,剩餘電池時間 (分鐘),240 分鐘
有效元件
搜尋者有時可能想知道哪些元件目前處於活動狀態,也就是可以對其採取動作 (請參閱「裝置動作」)。當提供者收到含有活動元件要求程式碼 (0x05) 的要求時,應在 1 秒內傳回回應,指出提供者的目前狀態。回應會使用有效元件回應代碼 (0x06),並包含額外資料,指出可用的元件。
如果是只有單一元件的供應者,如果沒有額外資料,應將其設為 0x00。例如,在低耗電模式下,系統不會執行媒體播放作業。否則,應將額外資料設為 0x01。
如果是含有多個元件的耳機 (例如左耳機和右耳機),額外資料中的每個位元都代表該元件是否處於活動狀態。非活動元件的例子可能是裝在盒子中且未使用的耳機。針對左耳機和右耳機的充電盒:
- 0x00 (0b00000000):兩個耳機都未開啟
- 0x01 (0b00000001):右耳機啟用,左耳機未啟用
- 0x02 (0b00000010):左耳機使用中,右耳機未使用
- 0x03 (0b00000011):兩個耳機皆已開啟
供應商可能會根據連結的平台採取不同的做法。快速配對功能目前僅適用於 Android 裝置,但日後可能會擴大支援範圍。
訊息會包含第一個位元組,用於在額外資料中識別平台類型:
系統會根據各個平台自訂第二個位元組。在 Android 中,這會參照 SDK 版本。舉例來說,Android Pie 的值為 28 (0x1C)。
韌體版本
供應商的韌體版本,以 UTF-8 編碼的字串表示。這項資訊與 韌體修訂版本特性中的資訊相同。
目前的 FHN 暫時 ID
宣傳 FHN 影格內容的供應商應回報目前的 FHN 暫時 ID (EID) 和目前的時鐘值,以便在時鐘漂移 (例如電池沒電) 時與 Seeker 同步。
例如:
- 0x03:裝置資訊事件
- 0x0B:目前的 FHN 暫時 ID 訊息
- 0x0018:額外資料,長度為 24 或 36 個位元組
- 0x13F9EA80:其他資料 (時鐘值;4 個位元組)
- 0x1122334455667788990011223344556677889900:其他資料 (目前的 EID;20 或 32 個位元組)
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-13 (世界標準時間)。
[null,null,["上次更新時間:2025-08-13 (世界標準時間)。"],[[["\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)"]]