当前位置: 首页>>代码示例>>Java>>正文


Java UsbDeviceErrorEvent类代码示例

本文整理汇总了Java中javax.usb.event.UsbDeviceErrorEvent的典型用法代码示例。如果您正苦于以下问题:Java UsbDeviceErrorEvent类的具体用法?Java UsbDeviceErrorEvent怎么用?Java UsbDeviceErrorEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


UsbDeviceErrorEvent类属于javax.usb.event包,在下文中一共展示了UsbDeviceErrorEvent类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: errorEventOccurred

import javax.usb.event.UsbDeviceErrorEvent; //导入依赖的package包/类
/**
 *
 * @param udee
 */
@Override
public void errorEventOccurred(UsbDeviceErrorEvent udee)
{
    Logger.getLogger(UsbRobotArm.class.getName()).log(Level.SEVERE,
            udee.getUsbException().toString(), udee);
}
 
开发者ID:swordmaster2k,项目名称:robotarmedge,代码行数:11,代码来源:UsbRobotArm.java

示例2: errorEventOccurred

import javax.usb.event.UsbDeviceErrorEvent; //导入依赖的package包/类
@Override
public void errorEventOccurred(final UsbDeviceErrorEvent event)
{
    for (final UsbDeviceListener listener: toArray())
    {
        listener.errorEventOccurred(event);
    }
}
 
开发者ID:usb4java,项目名称:usb4java-javax,代码行数:9,代码来源:DeviceListenerList.java

示例3: testErrorEvent

import javax.usb.event.UsbDeviceErrorEvent; //导入依赖的package包/类
/**
 * Tests the error event.
 */
@Test
public void testErrorEvent()
{
    final UsbDeviceErrorEvent event = new UsbDeviceErrorEvent(
        mock(UsbDevice.class), mock(UsbControlIrp.class));
    final UsbDeviceListener a = mock(UsbDeviceListener.class);
    final UsbDeviceListener b = mock(UsbDeviceListener.class);
    this.list.add(a);
    this.list.add(b);
    this.list.errorEventOccurred(event);
    verify(a).errorEventOccurred(event);
    verify(b).errorEventOccurred(event);
}
 
开发者ID:usb4java,项目名称:usb4java-javax,代码行数:17,代码来源:DeviceListenerListTest.java

示例4: testDetachedEvent

import javax.usb.event.UsbDeviceErrorEvent; //导入依赖的package包/类
/**
 * Tests the detached event.
 */
@Test
public void testDetachedEvent()
{
    final UsbDeviceErrorEvent event = new UsbDeviceErrorEvent(
        mock(UsbDevice.class), mock(UsbControlIrp.class));
    final UsbDeviceListener a = mock(UsbDeviceListener.class);
    final UsbDeviceListener b = mock(UsbDeviceListener.class);
    this.list.add(a);
    this.list.add(b);
    this.list.usbDeviceDetached(event);
    verify(a).usbDeviceDetached(event);
    verify(b).usbDeviceDetached(event);
}
 
开发者ID:usb4java,项目名称:usb4java-javax,代码行数:17,代码来源:DeviceListenerListTest.java

示例5: testAbstractMethods

import javax.usb.event.UsbDeviceErrorEvent; //导入依赖的package包/类
/**
 * Ensure the existence of the needed methods.
 */
@Test
public void testAbstractMethods()
{
    final UsbDeviceListener adapter = new UsbDeviceAdapter()
    {
        // Empty
    };
    adapter.usbDeviceDetached((UsbDeviceEvent) null);
    adapter.dataEventOccurred((UsbDeviceDataEvent) null);
    adapter.errorEventOccurred((UsbDeviceErrorEvent) null);
}
 
开发者ID:usb4java,项目名称:usb4java-javax,代码行数:15,代码来源:UsbDeviceAdapterTest.java

示例6: errorEventOccurred

import javax.usb.event.UsbDeviceErrorEvent; //导入依赖的package包/类
@Override
public void errorEventOccurred(UsbDeviceErrorEvent usbEvent) {
	logger.debug("received error event from device {}", usbEvent);
	if (isGeneratedByAKnownDevice(usbEvent.getUsbDevice())) {
		Controller controller = extractUsbController(usbEvent.getUsbDevice());
		Event event = UsbEvent.failure(usbEvent.getUsbException());
		this.eventListener.onEvent(controller, event);
	}
}
 
开发者ID:quirinobrizi,项目名称:jax10,代码行数:10,代码来源:X10EventListener.java

示例7: errorEventOccurred

import javax.usb.event.UsbDeviceErrorEvent; //导入依赖的package包/类
@Override
public void errorEventOccurred(final UsbDeviceErrorEvent event)
{
    // Empty
}
 
开发者ID:usb4java,项目名称:usb4java-javax,代码行数:6,代码来源:UsbDeviceAdapter.java


注:本文中的javax.usb.event.UsbDeviceErrorEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。