Livt packages
Livt.Usb
Version 0.0.5
USB 2.0 low/full-speed PHY, host transfers, device discovery, HID keyboard, and read-only mass storage for Livt.
Published files (57)
- BulkOnlyControllerModel.lvt
- BulkOnlyTransportTest.lvt
- ControllerClient.lvt
- ControllerDispatchProbe.lvt
- ControllerDispatchTest.lvt
- DescriptorKeyboardTest.lvt
- DescriptorStorageTest.lvt
- HostControllerTest.lvt
- MassStorageHostTest.lvt
- PacketBufferConfigurationTest.lvt
- PacketBufferTest.lvt
- PacketCodecTest.lvt
- PacketReceiverTest.lvt
- RootPortTiming144Test.lvt
- RootPortTiming48Test.lvt
- RootPortTiming96Test.lvt
- TransactionBypassTest.lvt
- TransactionPipelineProbe.lvt
- TransactionPipelineTest.lvt
- Usb2PhyTest.lvt
tests/ControllerDispatchProbe.lvt
namespace Livt.Usb.Tests
using Livt.Usb
/**
* Consumer with both constructor-bound and function-parameter interface dispatch.
*/
component ControllerDispatchProbe
{
// Borrowed controller, retained for the probe lifetime.
controller: IHostController
/**
* Binds an interchangeable controller without owning its implementation.
*/
new(controller: IHostController)
{
this.controller = controller
}
/**
* Reads through a stored interface; completion must capture the actual return value.
*/
public fn ReadBoundCapacity() int
{
return controller.GetTransferCapacity()
}
/**
* Exercises the extra dispatch hops of an interface-typed function parameter.
*/
public fn ReadParameterCapacity(other: IHostController) int
{
return other.GetTransferCapacity()
}
/**
* Reads completed input through a constructor-bound interface dependency.
*/
public fn TryReadInput(index: int, value: out byte) bool
{
return controller.TryReadInput(index, value)
}
}