با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
ارائه دهندگان می توانند از طریق جریان پیام به جستجوگر درباره اطلاعات دستگاه اطلاع دهند.
نام گروه پیام | ارزش |
---|
رویداد اطلاعات دستگاه | 0x03 |
اطلاعات دستگاه نام کد | ارزش |
---|
شناسه مدل | 0x01 |
آدرس BLE به روز شد | 0x02 |
باتری به روز شد | 0x03 |
زمان باقی مانده باتری | 0x04 |
درخواست اجزای فعال | 0x05 |
پاسخ اجزای فعال | 0x06 |
(منسوخ شده) قابلیت ها | 0x07 |
نوع پلت فرم | 0x08 |
نسخه سیستم عامل | 0x09 |
شناسه زودگذر FHN فعلی | 0x0B |
شناسه مدل
هنگامی که RFCOMM متصل می شود، اطلاعات شناسه مدل (برای نوشتن عطف به ماسبق کردن حساب حساب ) باید به جستجوگر ارسال شود. به عنوان مثال، 0x03010003AABBCC
خواهد بود:
- 0x03: رویداد اطلاعات دستگاه
- 0x01: مقدار شناسه مدل
- 0x0003: داده های اضافی، طول 3
- 0xAABBCC: داده های اضافی، شناسه مدل
آدرس BLE
هنگام اتصال RFCOMM و هر زمان که آدرس چرخانده می شود، اطلاعات آدرس BLE (برای نوشتن عطف به ماسبق ، در صورت وجود، باید به جستجوگر ارسال شود. به عنوان مثال، 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): هر دو جوانه فعال هستند
ارائه دهندگان ممکن است بخواهند بر اساس پلتفرمی که به آن متصل هستند عملکرد متفاوتی داشته باشند. Fast Pair در حال حاضر فقط از طریق Android انجام می شود، اما ممکن است پشتیبانی در آینده گسترش یابد.
این پیام حاوی اولین بایت شناسایی کننده نوع پلت فرم در داده های اضافی خواهد بود:
نام پلتفرم | ارزش |
---|
اندروید | 0x01 |
بایت دوم در هر پلتفرم سفارشی می شود. در اندروید به نسخه SDK اشاره خواهد کرد. به عنوان مثال، Android Pie دارای مقدار 28 (0x1C) خواهد بود.
نسخه سیستم عامل
نسخه سیستم عامل ارائه دهنده به عنوان یک رشته در رمزگذاری utf-8. این همان اطلاعاتی است که در مشخصه بازبینی سیستم عامل وجود دارد.
شناسه زودگذر FHN فعلی
ارائهدهندگانی که فریمهای FHN را تبلیغ میکنند باید شناسه زودگذر FHN (EID) را با مقدار ساعت فعلی خود گزارش دهند تا در صورت تغییر ساعت (مثلاً به دلیل تخلیه باتری) با جستجوگر همگام شود.
به عنوان مثال:
- 0x03: رویداد اطلاعات دستگاه
- 0x0B: پیام شناسه زودگذر FHN فعلی
- 0x0018: داده های اضافی، طول 24 یا 36 بایت
- 0x13F9EA80: داده های اضافی (مقدار ساعت؛ 4 بایت)
- 0x1122334455667788990011223344556677889900: داده های اضافی (EID فعلی؛ 20 یا 32 بایت)
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده 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)"]]