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.
Hành động trên thiết bị
Người tìm kiếm có thể yêu cầu Nhà cung cấp thực hiện một hành động. Nếu Nhà cung cấp hỗ trợ hành động này, thì hành động đó phải được xác nhận và thực hiện, nếu không thì hành động đó sẽ bị bỏ qua.
Tên nhóm tin nhắn
Giá trị
Sự kiện hành động trên thiết bị
0x04
Tên mã hành động của thiết bị
Giá trị
Đổ chuông
0x01
Đổ chuông thiết bị
Một trường hợp sử dụng cho các thao tác này là Người tìm kiếm yêu cầu Nhà cung cấp đổ chuông, chẳng hạn như khi người dùng làm mất thiết bị và cần xác định vị trí của thiết bị. Khi nhận được thao tác đổ chuông, Nhà cung cấp sẽ bắt đầu phát một tệp âm thanh được tải sẵn ở âm lượng đủ lớn để người dùng có thể xác định vị trí của thiết bị. Bạn nên tăng dần âm lượng từ thấp đến tối đa theo thời gian. Chuông sẽ tiếp tục đổ chuông cho đến khi nhận được một hành động khác yêu cầu dừng hoặc đã hết thời gian chờ.
Dữ liệu bổ sung sẽ được đưa vào thông báo để cho biết có nên bắt đầu hoặc dừng đổ chuông hay không. Dữ liệu này có thể được mở rộng để hỗ trợ Nhà cung cấp có nhiều thành phần (tai nghe bên trái và bên phải). Trong byte đầu tiên, các bit sẽ được đặt thành 1 để yêu cầu bắt đầu đổ chuông hoặc 0 để yêu cầu dừng đổ chuông.
Ví dụ: nếu byte đầu tiên của dữ liệu bổ sung được đặt thành:
0x00 (0b00000000): Tất cả các thành phần phải ngừng đổ chuông
0x01 (0b00000001): Đổ chuông bên phải, ngừng đổ chuông bên trái
0x02 (0b00000010): Đổ chuông bên trái, ngừng đổ chuông bên phải
0x03 (0b00000011): Đổ chuông cả bên trái và bên phải
Trên những Nhà cung cấp không hỗ trợ chế độ đổ chuông riêng lẻ, chỉ nên xem xét 1 bit:
0x00 (0b00000000): Ngừng đổ chuông
0x01 (0b00000001): Bắt đầu đổ chuông
Nếu có, byte thứ hai trong dữ liệu bổ sung sẽ biểu thị thời gian chờ tính bằng giây. Nhà cung cấp nên sử dụng giá trị này để xác định thời gian đổ chuông trước khi tự tắt tiếng. Dựa trên ví dụ về quyền đổ chuông ở trên và thời gian chờ là 60 giây, 0x013C sẽ được truyền dưới dạng dữ liệu bổ sung.
Đồng bộ hoá trạng thái đổ chuông trở lại với Người tìm kiếm
Các Nhà cung cấp có thể muốn thông báo cho Người tìm kiếm khi Người tìm kiếm thay đổi trạng thái đổ chuông, ví dụ: nếu một cử chỉ khiến chuông ngừng đổ. Sau đó, Người tìm kiếm có thể nhận được thông báo và cập nhật giao diện người dùng nếu cần.
Nhà cung cấp phải tuân theo cùng một định dạng thông báo như được xác định trong ví dụ ở trên. Seeker sẽ lắng nghe thông báo này và đưa ra thông báo xác nhận khi nhận được thông báo.
Xác nhận một hành động
Khi nhận được một thao tác, thao tác đó phải được xác nhận để Seeker biết thao tác đó có được thực hiện hay không. Nếu không nhận được tín hiệu xác nhận trong vòng 1 giây kể từ khi gửi một thao tác (hoặc nhận được tín hiệu xác nhận tiêu cực), thì Seeker sẽ giả định rằng thao tác đó hiện không được hỗ trợ.
[[["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\u003eSeekers can request Providers to perform actions, such as ringing, which should be acknowledged and performed if supported.\u003c/p\u003e\n"],["\u003cp\u003eRinging can be initiated and stopped for single or dual components (like earbuds) using specific data values, with optional timeout duration.\u003c/p\u003e\n"],["\u003cp\u003eProviders can notify Seekers of ringing status changes, enabling UI updates on the Seeker's end.\u003c/p\u003e\n"],["\u003cp\u003eSeekers expect acknowledgements within 1 second to confirm action execution, otherwise assuming unsupported functionality.\u003c/p\u003e\n"],["\u003cp\u003eDevice actions use a specific message group and action codes for communication between Seekers and Providers.\u003c/p\u003e\n"]]],["Seekers request Providers to perform actions, like ringing. Providers acknowledge and execute supported actions or ignore unsupported ones. The \"Ring\" action (0x01) initiates a preloaded sound, potentially ramping up in volume until stopped or timed out. The first data byte indicates which components (e.g., left/right) should ring, using bit flags (1 for start, 0 for stop). The second byte sets a timeout in seconds. Providers should update Seekers of changes to the ringing status, and Seekers must acknowledge the action.\n"],null,["Device action\n-------------\n\nSeekers can request that a Provider takes an action. If the action is supported\nby the Provider, it should be acknowledged and performed, otherwise it should be\nignored.\n\n| Message Group Name | Value |\n|---------------------|-------|\n| Device action event | 0x04 |\n\n| Device Action Code Name | Value |\n|-------------------------|-------|\n| Ring | 0x01 |\n\n### Ringing a device\n\nOne use case for these actions is the Seeker requesting the Provider to ring,\nfor example when a user has lost the device and needs to locate it. When the\nring action is received, the Provider should begin playing a preloaded sound\nfile at a high enough volume that the user is able to locate it. It is\nrecommended that the sound be ramped from a low volume to max volume over\ntime. Ringing should continue until an additional action is received\ndirecting a stop, or a timeout value has passed.\n\nAdditional data will be included in the message to indicate whether the ringing\nshould be started or stopped, which can be expanded to support Providers with\nmultiple components (a left and right bud). In the first byte, bits will be set\nto 1 to request a ring to start or 0 to request a ring to stop.\n\nFor example, if the first byte of additional data is set to:\n\n- 0x00 (0b00000000): All components should stop ringing\n- 0x01 (0b00000001): Ring right, stop ringing left\n- 0x02 (0b00000010): Ring left, stop ringing right\n- 0x03 (0b00000011): Ring both left and right\n\nOn Providers which do not support individual ringing, only 1 bit should be\nconsidered:\n\n- 0x00 (0b00000000): Stop ringing\n- 0x01 (0b00000001): Start ringing\n\n| **Note:** For Providers that include on-head detection, consider checking whether the device is on-head before ringing at max volume.\n\nThe second byte in additional data, if present, represents the timeout in\nseconds. This value should be used by the Provider to determine how long it\nshould ring before silencing itself. Based off of the ring right example above\nand a timeout of 60 seconds, `0x013C` would be passed as the additional data.\n\n#### Syncing ringing status back to Seekers\n\nProviders may want to notify a Seeker when it changes the ringing status, for\nexample if a gesture causes the ringing to stop. The Seeker can then receive\nthe message and update the UI if necessary.\n\nThe Provider should follow the same message format as defined in the example\nabove. Seeker's will listen for this message and provide an acknowledgement when\nit is received.\n\n### Acknowledging an action\n\nWhen an action is received, it should be\n[acknowledged](/nearby/fast-pair/specifications/extensions/acknowledgement#MessageStreamAcknowledgements \"Acknowledgements\") so that the Seeker knows whether\nor not the action was performed. If an acknowledgement is not received within 1\nsecond of sending an action (or a negative-acknowledgement is received) the\nSeeker will assume the action is not currently supported."]]