Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Nhà cung cấp có thể thông báo cho Người tìm thông tin về thiết bị thông qua luồng thông báo.
Tên nhóm tin nhắn |
Giá trị |
Sự kiện thông tin thiết bị |
0x03 |
Tên mã thông tin thiết bị |
Giá trị |
Mã kiểu máy |
0x01 |
Đã cập nhật địa chỉ BLE |
0x02 |
Đã cập nhật pin |
0x03 |
Thời lượng pin còn lại |
0x04 |
Yêu cầu thành phần đang hoạt động |
0x05 |
Phản hồi về thành phần đang hoạt động |
0x06 |
(Không dùng nữa)Chức năng |
0x07 |
Loại nền tảng |
0x08 |
Phiên bản chương trình cơ sở |
0x09 |
Giá trị nhận dạng tạm thời hiện tại của FHN |
0x0B |
Mã kiểu máy
Thông tin mã nhận dạng mô hình (để Ghi lại AccountKey) sẽ được gửi đến Trình tìm kiếm khi RFCOMM kết nối. Ví dụ: 0x03010003AABBCC
sẽ là:
- 0x03: Sự kiện thông tin thiết bị
- 0x01: Giá trị mã nhận dạng mẫu
- 0x0003: Dữ liệu bổ sung, độ dài 3
- 0xAABBCC: Dữ liệu bổ sung, mã mô hình
Địa chỉ BLE
Thông tin địa chỉ BLE (để Ghi lại AccountKey) (nếu có) cũng phải được gửi đến Trình tìm kiếm khi RFCOMM kết nối và bất cứ khi nào địa chỉ được xoay. Ví dụ: 0x03020006AABBCCDDEEFF
sẽ là:
- 0x03: Sự kiện thông tin thiết bị
- 0x02: Giá trị địa chỉ BLE
- 0x0006: Dữ liệu bổ sung, độ dài 6
- 0xAABBCCDDEEFF: Dữ liệu bổ sung, địa chỉ BLE
Đã cập nhật pin
Đối với những Nhà cung cấp hỗ trợ thông báo pin, bạn cũng có thể gửi thông tin pin qua RFCOMM. Khi RFCOMM kết nối hoặc giá trị pin thay đổi, hệ thống sẽ gửi thông tin cập nhật. Phần dữ liệu bổ sung của gói phải chứa dữ liệu giống với các byte s + 2, s + 3, s + 4 khi quảng cáo dữ liệu pin qua BLE. Ví dụ:0x0303000357417F
sẽ là:
- 0x03: Sự kiện thông tin thiết bị
- 0x03: Giá trị pin
- 0x0003: Dữ liệu bổ sung, độ dài 3
- 0x57417F: Dữ liệu bổ sung, giá trị pin
- 0x57: Giá trị của tai nghe bên trái, không sạc, pin 87%
- 0x41: Giá trị của tai nghe bên phải, không sạc, pin còn 65%
- 0x7F: Giá trị trường hợp, không sạc, pin không xác định
Nhà cung cấp cũng có thể cập nhật thời lượng pin còn lại (nếu biết). Ví dụ: 0x03040001F0
sẽ là:
- 0x03: Sự kiện thông tin thiết bị
- 0x04: Thời lượng pin còn lại
- 0x0001: Dữ liệu bổ sung, độ dài 1 (có thể là 2 đối với uint16 nếu cần.)
- 0xF0: Dữ liệu bổ sung, thời lượng pin còn lại tính bằng phút, 240 phút
Thành phần đang hoạt động
Đôi khi, trình tìm kiếm có thể muốn biết thành phần nào đang hoạt động, nghĩa là có thể thực hiện hành động trên các thành phần đó (xem phần Hành động trên thiết bị).
Khi Nhà cung cấp nhận được một yêu cầu chứa mã yêu cầu thành phần đang hoạt động (0x05), hệ thống sẽ trả về một phản hồi trong vòng 1 giây cho biết trạng thái hiện tại của Nhà cung cấp. Phản hồi sẽ sử dụng mã phản hồi thành phần đang hoạt động (0x06) và chứa dữ liệu bổ sung cho biết thành phần nào có sẵn.
Đối với Nhà cung cấp có một thành phần, dữ liệu bổ sung phải được đặt thành 0x00 nếu không có. Ví dụ: chế độ tiết kiệm pin sẽ không phát nội dung nghe nhìn. Nếu không, bạn phải đặt dữ liệu bổ sung thành 0x01.
Đối với tai nghe có nhiều thành phần (ví dụ: tai nghe bên trái và bên phải), mỗi bit trong dữ liệu bổ sung sẽ cho biết thành phần đó có đang hoạt động hay không. Ví dụ về một thành phần không hoạt động có thể là một nút đang ở trong hộp và không được sử dụng. Cụ thể đối với hộp đựng tai nghe trái và phải:
- 0x00 (0b00000000): Cả hai tai nghe đều không hoạt động
- 0x01 (0b00000001): Tai nghe bên phải đang hoạt động, tai nghe bên trái không hoạt động
- 0x02 (0b00000010): Tai nghe trái đang hoạt động, tai nghe phải không hoạt động
- 0x03 (0b00000011): Cả hai tai nghe đều đang hoạt động
Nhà cung cấp có thể muốn thực hiện theo cách khác nhau dựa trên nền tảng mà họ được kết nối. Tính năng Ghép nối nhanh hiện chỉ được thực hiện thông qua Android, nhưng có thể được mở rộng hỗ trợ trong tương lai.
Thông báo sẽ chứa một byte đầu tiên xác định loại nền tảng trong dữ liệu bổ sung:
Tên nền tảng |
Giá trị |
Android |
0x01 |
Byte thứ hai sẽ được tuỳ chỉnh theo từng nền tảng. Trong Android, thuộc tính này sẽ tham chiếu đến phiên bản SDK. Ví dụ: Android Pie sẽ có giá trị là 28 (0x1C).
Phiên bản chương trình cơ sở
Phiên bản phần mềm của nhà cung cấp dưới dạng chuỗi được mã hoá utf-8.
Đây là thông tin giống như trong Đặc điểm sửa đổi chương trình cơ sở.
Giá trị nhận dạng tạm thời hiện tại của FHN
Các nhà cung cấp quảng cáo khung FHN phải báo cáo Giá trị nhận dạng tạm thời (EID) của FHN hiện tại cùng với giá trị đồng hồ hiện tại để đồng bộ hoá với Trình tìm kiếm trong trường hợp đồng hồ bị trễ (ví dụ: do pin đã cạn).
Ví dụ:
- 0x03: Sự kiện thông tin thiết bị
- 0x0B: Thông báo về giá trị nhận dạng tạm thời FHN hiện tại
- 0x0018: Dữ liệu bổ sung, độ dài 24 hoặc 36 byte
- 0x13F9EA80: Dữ liệu bổ sung (giá trị xung nhịp; 4 byte)
- 0x1122334455667788990011223344556677889900: Dữ liệu bổ sung (EID hiện tại; 20 hoặc 32 byte)
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-08-13 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 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)"]]