با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
کنترل های شنیدنی
هدف کنترلهای قابل شنیدن در جفت سریع، ارائه کنترلهای دسترسی بهتر برای ویژگیهای مهم Hearable در Android است. برای رسیدن به این هدف، یک گروه پیام جدید، کنترلهای شنیدنی در جریان پیام اضافه شده است.
نام گروه پیام | ارزش |
---|
کنترل شنیدنی | 0x08 |
کنترل نویز فعال
کنترل نویز فعال در حال تبدیل شدن به یک ویژگی برجسته برای هدفون های پریمیوم است. در سمت Seeker، Fast Pair دارای رابط کاربری و منطق برای تنظیم، دریافت و ذخیره وضعیت است و حالت در سمت Provider ذخیره خواهد شد. برای ارائه دهنده اجباری است که هنگام اتصال جریان رویداد، Session Nonce را ارسال کند. برای رسیدن به این هدف، کدهای پیام زیر تعریف شده است:
نام کد پیام | ارزش | فرستنده | پاسخگو | MAC | ACK |
---|
وضعیت ANC را دریافت کنید | 0x11 | جوینده | ارائه دهنده | ن | ن |
حالت ANC را تنظیم کنید | 0x12 | جوینده | ارائه دهنده | Y | Y |
به ایالت ANC اطلاع دهید | 0x13 | ارائه دهنده | جوینده | ن | ن |
هنگامی که جستجوگر به یک ارائهدهنده متصل میشود، یا زمانی که یک ارائهدهنده پیام «دریافت وضعیت ANC» را دریافت میکند، ارائهدهنده میتواند به وضعیت ANC اطلاع دهد تا جستجوگر قابلیت ANC و وضعیت ذخیرهشدهاش را بداند. پیام به شرح زیر است:
بایت | نوع داده | توضیحات | ارزش |
---|
0 | uint8 | کنترل شنیدنی | 0x08 |
1 | uint8 | به ایالت ANC اطلاع دهید | 0x13 |
2 - 3 | uint16 | طول داده های اضافی | 0x04 |
4 - 7 | | داده های کنترل ANC | متفاوت است |
داده های کنترل ANC
بایت | نوع داده | توضیحات | ارزش |
---|
0 | uint8 | کد نسخه | متفاوت است ، 0x02 برای این نسخه |
1 | پرچم ها | UI تغییر می کند هر حالت با توجه به مقدار بیت پرچم خود (1) فعال یا غیرفعال می شود (0) به شرح زیر: بیت 0 (MSB): شفاف بیت 1: تطبیقی (یا 0 اگر پشتیبانی نمی شود) بیت 2: خاموش بیت 3: رزرو شده (بیت را روی 0 تنظیم کنید) بیت 4: ANC | متفاوت است |
2 | پرچم ها | ضامن های قابل تنظیم ممکن است تمام یا هر یک از بیتهای تغییر رابط کاربری در بالا نیز در اینجا تنظیم شوند تا مشخص شود کدام بیتها در حال حاضر فعال هستند. | متفاوت است |
3 | پرچم ها | وضعیت فعلی فقط یک بیت را می توان تنظیم کرد و مقدار این بایت باید غیر صفر باشد. | متفاوت است |
جستجوگر رابط کاربری تغییر کاربری را مطابق دادههای کنترل ANC نشان میدهد.
مثال 1: ارائه دهنده از ANC 3 طرفه پشتیبانی می کند: شفاف - خاموش - ANC و جوانه ها روی سر هستند، همه حالت ها اکنون قابل تنظیم هستند و وضعیت فعلی خاموش است:
بایت | نوع داده | توضیحات | ارزش |
---|
0 | uint8 | کد نسخه | 0x01 |
1 | پرچم ها | UI تغییر می کند | 0b10101000 |
2 | پرچم ها | ضامن های قابل تنظیم | 0b10101000 |
3 | پرچم ها | وضعیت فعلی | 0b00100000 |
مثال 2: ارائه دهنده از ANC 3 طرفه پشتیبانی می کند: شفاف - خاموش - ANC، فقط یک جوانه در حال حاضر روی سر است یا هیچ جوانه ای روی سر نیست، بنابراین هیچ حالتی قابل تنظیم نیست و وضعیت فعلی خاموش است:
بایت | نوع داده | توضیحات | ارزش |
---|
0 | uint8 | کد نسخه | 0x01 |
1 | پرچم ها | تغییر رابط کاربری | 0b10101000 |
2 | پرچم ها | کلید قابل تنظیم | 0b00000000 |
3 | پرچم ها | وضعیت فعلی | 0b00100000 |
اگر کاربر ضامن را تغییر دهد، جستجوگر وضعیت فعلی را به صورت زیر روی Provider تنظیم می کند:
بایت | نوع داده | توضیحات | ارزش |
---|
0 | uint8 | کنترل شنیدنی | 0x08 |
1 | uint8 | حالت ANC را تنظیم کنید | 0x12 |
2 - 3 | uint16 | طول داده های اضافی | متفاوت است ، 0x04 یا 0x14 |
4 | uint8 | کد نسخه جستجوگر | متغیر است ، 0x01 یا 0x02 |
5 | پرچم ها | حالت های قابل تنظیم ANC (تغییر رابط کاربری) | متفاوت است |
6 | پرچم ها | حالت های فعال ANC (تغییر قابل تنظیم) | متفاوت است |
7 | پرچم ها | نمایه حالت ANC جدید (وضعیت جدید) | متفاوت است |
8 - 23 | | رزرو شده است | متفاوت است |
بایت 4 - 7 در واقع داده های کنترل ANC است که از سمت Seeker ارسال می شود. اگر مقدار طول اضافی 0x14 تنظیم شود، بایت های رزرو شده 8-23 وجود خواهند داشت و در صورت دریافت این بایت ها، ارائه دهنده باید آنها را نادیده بگیرد. اگر مقدار طول اضافی به عنوان 0x04 تنظیم شود، هیچ بایت رزرو شده ای وجود ندارد.
هنگامی که یک ارائهدهنده پیام «تنظیم وضعیت ANC» را دریافت میکند، باید وضعیت ANC را تأیید کند و به همه جویندگان متصل اطلاع دهد. اگر کاربر تنظیمات را از طریق اشاره هدست یا برنامه همراه تغییر دهد، ارائهدهنده باید اعلان را برای همه جستجوگران متصل ارسال کند.
مثال 3: ارائه دهنده از ANC 4 طرفه پشتیبانی می کند: شفاف - تطبیقی - خاموش - ANC، جوانه ها روی سر هستند، همه حالت ها اکنون قابل تنظیم هستند، و وضعیت فعلی تطبیقی است:
بایت | نوع داده | توضیحات | ارزش |
---|
0 | uint8 | کد نسخه | 0x01 |
1 | پرچم ها | تغییر رابط کاربری | 0b11101000 |
2 | پرچم ها | کلید قابل تنظیم | 0b11101000 |
3 | پرچم ها | وضعیت فعلی | 0b01000000 |
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-08-28 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-28 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eHearable Controls utilize Message Stream to enhance access to headphone features on Android.\u003c/p\u003e\n"],["\u003cp\u003eActive Noise Control (ANC) functionality allows for setting, retrieving, and saving noise cancellation preferences.\u003c/p\u003e\n"],["\u003cp\u003eANC state is communicated between devices, allowing the user interface to reflect available and current noise control modes.\u003c/p\u003e\n"],["\u003cp\u003eANC state can be controlled by the user via device UI and is synchronized across connected devices through notifications.\u003c/p\u003e\n"]]],["Hearable controls are added within the Message Stream for better access to hearable features. Active Noise Control (ANC) functionality is implemented, allowing the Seeker to get, set, and save the ANC state, which is stored by the Provider. The Provider can notify the Seeker of ANC capabilities and stored state. UI toggles for ANC are managed via flags, including transparent, off, and ANC modes. The Seeker sends a \"Set ANC state\" message to update the current ANC mode. The Provider must acknowledge these messages and notify connected Seekers.\n"],null,["Hearable Controls\n\nHearable controls on Fast Pair aim to provide better access controls for\nimportant Hearable features on Android. A new message group Hearable\ncontrols inside [Message Stream](/nearby/fast-pair/specifications/extensions/messagestream#MessageStream \"Message Stream\") has been added to achieve this.\n\n| Message Group Name | Value |\n|--------------------|-------|\n| Hearable control | 0x08 |\n\nActive noise control\n\nActive noise control is becoming a prominent feature for premium headphones. On\nthe Seeker side, Fast Pair will have the UI and logic to set, get and save the\nstate, and the state will be stored on the Provider side.\nIt is mandatory for provider to send [Session Nonce](/nearby/fast-pair/specifications/extensions/mac#SessionAndMessageNonce \"Session Nonce\") when event\nstream is connected.\nTo achieve this, below message codes are defined:\n\n| Message Code Name | Value | Sender | Responder | MAC | ACK |\n|-------------------|-------|----------|-----------|-----|-----|\n| Get ANC state | 0x11 | Seeker | Provider | N | N |\n| Set ANC state | 0x12 | Seeker | Provider | Y | Y |\n| Notify ANC state | 0x13 | Provider | Seeker | N | N |\n\nWhen a Seeker connects to a Provider, or when a Provider receives a \"Get ANC\nstate\" message, the Provider\ncan Notify the ANC state to let the Seeker know its ANC capability and its\nstored state. The message is as follow:\n\n| Byte | Data Type | Description | Value |\n|-------|-----------|-------------------------------------|----------|\n| 0 | uint8 | Hearable control | 0x08 |\n| 1 | uint8 | Notify ANC state | 0x13 |\n| 2 - 3 | uint16 | Additional data length | 0x04 |\n| 4 - 7 | | [ANC control data](#ANCControlData) | *varies* |\n\nANC control data\n\n| Byte | Data Type | Description | Value |\n|------|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------|\n| 0 | uint8 | Version code | *varies*, 0x02 for this version |\n| 1 | Flags | UI toggles Each mode is enabled (1) or disabled (0) according to the value of its flag bit, as follows: Bit 0 (MSB): transparent Bit 1: adaptive (or 0 if it is not supported) Bit 2: off Bit 3: Reserved (Set bit to 0) Bit 4: ANC | *varies* |\n| 2 | Flags | Settable toggles Any or all of the UI toggle bits above may also be set here, to indicate which are currently enabled. | *varies* |\n| 3 | Flags | Current state Only one bit can be set and value of this byte shall be non zero. | *varies* |\n\nThe Seeker will show the toggle UI according to the ANC control data.\n\nExample 1: The Provider supports 3-way ANC: transparent - off - ANC \\& buds are\non-head, all modes are settable now, and current state is off:\n\n| Byte | Data Type | Description | Value |\n|------|-----------|------------------|------------|\n| 0 | uint8 | Version code | 0x01 |\n| 1 | Flags | UI toggles | 0b10101000 |\n| 2 | Flags | Settable toggles | 0b10101000 |\n| 3 | Flags | Current state | 0b00100000 |\n\nExample 2: The Provider supports 3-way ANC: transparent - off - ANC, only one\nbud is on-head now or no buds is on-head, so no modes are settable, and the\ncurrent state is off:\n\n| Byte | Data Type | Description | Value |\n|------|-----------|-----------------|------------|\n| 0 | uint8 | Version code | 0x01 |\n| 1 | Flags | UI toggle | 0b10101000 |\n| 2 | Flags | Settable toggle | 0b00000000 |\n| 3 | Flags | Current state | 0b00100000 |\n\nIf the user switches the toggle, the Seeker will set the current state to the\nProvider as follow:\n\n| Byte | Data Type | Description | Value |\n|--------|-----------|-------------------------------------|------------------------|\n| 0 | uint8 | Hearable control | 0x08 |\n| 1 | uint8 | Set ANC state | 0x12 |\n| 2 - 3 | uint16 | Additional data length | *varies*, 0x04 or 0x14 |\n| 4 | uint8 | Seeker Version code | *varies*, 0x01 or 0x02 |\n| 5 | Flags | ANC Settable modes (UI toggle) | *varies* |\n| 6 | Flags | ANC Enabled modes (Settable toggle) | *varies* |\n| 7 | Flags | New ANC mode index (New state) | *varies* |\n| 8 - 23 | | Reserved | *varies* |\n\nThe byte 4 - 7 is actually [ANC control data](#ANCControlData) sent from\nSeeker side. If additional length value is set as 0x14, the reserved bytes 8-23\nwould be present and on receipt of these bytes, the provider should ignore them.\nIf additional length value is set as 0x04, there are no reserved bytes present.\n\nWhen a Provider receives a \"Set ANC state\" message, it should [Acknowledge](/nearby/fast-pair/specifications/extensions/acknowledgement#MessageStreamAcknowledgements \"Message Stream Acknowledgements\"),\nand Notify ANC state to all connected Seekers.\nIf the user changes the setting via headset gesture or companion application,\nthe Provider should also send notification to all connected Seekers.\n\nExample 3: The Provider supports 4-way ANC: transparent - adaptive - off - ANC,\nbuds are on-head, all modes are settable now, and current state is adaptive:\n\n| Byte | Data Type | Description | Value |\n|------|-----------|-----------------|------------|\n| 0 | uint8 | Version code | 0x01 |\n| 1 | Flags | UI toggle | 0b11101000 |\n| 2 | Flags | Settable toggle | 0b11101000 |\n| 3 | Flags | Current state | 0b01000000 |"]]