alt setting
什么是alt setting. 经常会看到文档中有提到alternative setting.下面是网上找到的通俗的解释
Alternate setting
is used to provide the advantage of having two configuration on the fly even though the device has only one configuration.
The alternate setting of a USB
interface is define by the bAlternativeSetting
attribute in the device descriptor. AUSB
interface with an alternate settings can be used in two mode. For example aUSB
interface endpoints may act as INTERRUPT
pipes in normal settings, but might act asBULK
pipe in alternate settings providing you the facility of two different mode on the same interface. You just have to send aSetInterface
request to activate a settings. I myself didn't have to use it much though. And I think normally device drivers don't tend to use it as I couldn't find out any example driver.
如下图, interface one可以有两个功能,区别两个功能就是通过Alternate setting。
Interface descriptors have a bInterfaceNumber field specifying the Interface number and abAlternateSetting which allows an interface to change settings on the fly.