تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يمكن لموفّري الخدمة إشعار "المُستخدِم الباحث" بمعلومات الجهاز من خلال
بث الرسائل.
اسم مجموعة الرسائل |
القيمة |
حدث معلومات الجهاز |
0x03 |
اسم رمز معلومات الجهاز |
القيمة |
رقم تعريف الطراز |
0x01 |
تم تعديل عنوان BLE |
0x02 |
تم تعديل معلومات البطارية |
0x03 |
الوقت المتبقّي لبطارية الجهاز |
0x04 |
طلب المكوّنات النشطة |
0x05 |
استجابة المكونات النشطة |
0x06 |
(ميزة متوقّفة نهائيًا) الإمكانات |
0x07 |
نوع النظام الأساسي |
0x08 |
إصدار البرامج الثابتة |
0x09 |
المعرّف المؤقت الحالي لخدمة FHN |
0x0B |
رقم تعريف الطراز
يجب إرسال معلومات معرّف الطراز (لكتابة مفتاح الحساب بأثر رجعي) إلى جهاز البحث عند الاتصال عبر RFCOMM. على سبيل المثال، 0x03010003AABBCC
سيكون:
- 0x03: حدث معلومات الجهاز
- 0x01: قيمة معرّف الطراز
- 0x0003: بيانات إضافية، الطول 3
- 0xAABBCC: بيانات إضافية، معرّف الطراز
عنوان BLE
يجب أيضًا إرسال معلومات عنوان BLE (لكتابة مفتاح الحساب بأثر رجعي) إلى جهاز البحث إذا كانت متاحة عند ربط 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): كلتا سمّاعتَي الأذن نشطتَين
قد يرغب مقدّمو الخدمات في إجراء عمليات مختلفة استنادًا إلى المنصة التي يتم
الاتصال بها. لا يمكن حاليًا استخدام ميزة "الإقران السريع" إلا من خلال أجهزة Android، ولكن قد يتم توسيع نطاق استخدامها في المستقبل.
ستحتوي الرسالة على بايت أوّل يحدّد نوع المنصة في
البيانات الإضافية:
اسم المنصة |
القيمة |
Android |
0x01 |
سيتم تخصيص البايت الثاني لكل منصة. في Android، سيشير ذلك إلى
إصدار حزمة SDK. على سبيل المثال، سيكون لنظام التشغيل Android Pie القيمة 28 (0x1C).
إصدار البرامج الثابتة
إصدار البرامج الثابتة لموفّر الخدمة كسلسلة بترميز utf-8
هذه هي المعلومات نفسها الواردة في سمة تحديث البرامج الثابتة.
المعرّف المؤقت الحالي لخدمة FHN
على مقدّمي المحتوى الذين يعرضون إطارات FHN الإبلاغ عن المعرّف المؤقت (EID) الحالي لإطارات FHN مع قيمة الساعة الحالية لمزامنة الإطارات مع جهاز البحث في حال عدم دقة الساعة (على سبيل المثال، بسبب استنزاف البطارية).
على سبيل المثال:
- 0x03: حدث معلومات الجهاز
- 0x0B: رسالة المعرّف المؤقت الحالي لبروتوكول FHN
- 0x0018: بيانات إضافية، طولها 24 أو 36 بايت
- 0x13F9EA80: بيانات إضافية (قيمة الساعة، 4 بايت)
- 0x1122334455667788990011223344556677889900: بيانات إضافية (معرّف الجهاز الجوّال الحالي،
20 أو 32 بايت)
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 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)"]]