USBInTransferResult
Khả dụng hạn chế
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Note: This feature is available in Web Workers.
Giao diện USBInTransferResult của WebUSB API cung cấp kết quả từ lệnh gọi các phương thức transferIn() và controlTransferIn() của giao diện USBDevice. Nó đại diện cho kết quả từ yêu cầu truyền dữ liệu từ thiết bị USB đến USB host.
Hàm khởi tạo
USBInTransferResult()Thử nghiệm-
Tạo một đối tượng
USBInTransferResultmới với các trườngstatusvàdatađược cung cấp.
Thuộc tính phiên bản
USBInTransferResult.dataRead only Thử nghiệm-
Trả về đối tượng
DataViewchứa dữ liệu nhận được từ thiết bị USB, nếu có. USBInTransferResult.statusRead only Thử nghiệm-
Trả về trạng thái của yêu cầu truyền, một trong:
"ok"- Truyền thành công."stall"- Thiết bị chỉ ra lỗi bằng cách tạo điều kiện stall trên endpoint. Stall trên endpoint điều khiển không cần được xóa. Stall trên endpoint bulk hoặc interrupt phải được xóa bằng cách gọiclearHalt()trước khitransferIn()có thể được gọi lại."babble"- Thiết bị đáp lại với nhiều dữ liệu hơn dự kiến.
Thông số kỹ thuật
| Thông số kỹ thuật |
|---|
| WebUSB API> # usbintransferresult> |