Compartilhar via


Serial Bus and Subunit Plug Association (Windows CE 5.0)

Send Feedback

To establish connections between plugs, the connector must be notified of, or be able to identify, the serial bus plug numbers for each plug that is establishing a connection. Usually you connect to subunits, or connect between subunits. Serial bus plugs are general to the entire unit, usually the physical device, so the connector needs to be notified of or identify which serial bus plug on the unit refers to which plug on which subunit.

For example, in a sample camcorder, the single unit has two subunits. These are the tape and camera subunits. The unit has two input plugs and one output plug. The tape subunit has both a source and a destination subunit plug. The camera has a single plug, a source subunit plug. Subunit plugs can be source or destination, unit plugs can be input or output. Unit plugs are effectively serial bus plugs.

The following illustration shows the camcorder.

ms894014.ufd(en-us,MSDN.10).gif

For applications to receive data from the camera portion of this device, the application has to connect to a source subunit plug on the camera subunit. As the subunit plugs are more conceptual than physical, the application needs to either find which serial bus plug the required subunit plug is connected to, or the application needs to cause the subunit plug to be connected to a serial bus plug.

A subunit source plug cannot connect to a serial bus input plug, only to an output plug. An input plug can only be connected to a subunit destination plug. For example, the camera's subunit source plug 0 can only connect to a serial bus output plug. These connections between unit or serial bus plugs and subunit plugs is entirely internal to the device, and do not represent external bus connections in any form.

Once the connection is established, the application will be told that serial bus plug 2 on the camcorder unit is the correct target plug to connect to, and it can establish a streaming session to this plug and begin transferring data.

The plug associations between subunit plugs and serial bus plugs can be permanent. Local plugs are unit serial bus plugs. When a local plug is allocated, it is associated with a subunit plug. Local plugs allocated by a subunit at startup through IOCTL_UNIT_PROCESS_REGISTRY_PLUGS, are permanent. If this is the case, an external connecting application only needs to determine which serial bus plug to connect to. If the plug is not permanent, an external connecting application needs to request that the subunit establish an association between a subunit plug and a serial bus plug first. Depending on the AV/C commands used to do this, you may need to free the associations that are no longer used.

The unit filter driver takes care of most of the details in dealing with external requests for these types of issues and utilizes a set of callbacks into the virtual subunit driver to effect the individual changes.

Of the four callbacks that a virtual subunit must provide to the unit filter driver when it registers itself, these two have to do with making or breaking associations between serial bus and subunit plugs:

When called, the virtual subunit should create a new association, limit itself only to reusing permanent plugs, or a combination of both.

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.