TAILIEUCHUNG - USB Complete fourth- P13

USB Complete fourth- P13:This book focuses on Windows programming for PCs, but other computers and operating systems also have USB support, including Linux and Apple Computer’s Macintosh. Some real-time kernels also support USB. | Chapter 4 Device Removal When a user removes a device from the bus the hub disables the device s port. The host knows that the removal occurred after the hub notifies the host that an event has occurred and the host sends a Get Port Status request to learn what the event was. The device disappears from the Device Manager and the device s address becomes available to another newly attached device. Tips for Successful Enumeration Without successful enumeration the device and host can t perform other communications. Most chip companies provide example code which can serve as a model even if your application doesn t exactly match the example application. If your controller interfaces to an external CPU you may have to adapt code written for another chip. In general a device should assume nothing about what requests or events the host will initiate and should concentrate on responding to requests and events as they occur. The following tips can help avoid problems. Don t assume requests or events will occur in a specific order. Some requests such as Set Configuration require the device to be in the Address or Configured state so the request is valid only after the device has accepted a Set Address request. But the host has some flexibility in what requests to issue and in what order during enumeration. A host might also reset or suspend the bus at any time and the device must detect the event and respond appropriately. Be ready to abandon a control transfer or end it early. On receiving a new Setup packet a device must abandon any transfer in progress and begin the new one. On receiving an OUT token packet USB or STATUS Transaction Packet SuperSpeed the device must assume that the host is beginning the Status stage of the transfer even if the device hasn t sent all of the requested data in the Data stage. Don t attempt to send more data than the host requests. In the Data stage of a control read transfer a device should send no more than the amount of data the host

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.