Quantcast
Channel: 質問!ITmedia 新着質問(Java/253)
Viewing all articles
Browse latest Browse all 2439

javaのUSBの読込命令について質問

$
0
0
下記は(//========で囲まれた部分)、USBの読込命令に関連したコードです。 USBのデーターを読込みますと、読込みましたバイト数をsize_readDで返してきます。 読込むデーターが無い場合は、size_readDはゼロにならず、catchもされず、下記の 他のUSBExceptionが発生します。 Q1)ゼロを含めた読込みバイト数を返す読込み命令はありますか(例えば、readBulk)? /** * Dispatch an uncaught exception to the handler. This method is * intended to be called only by the JVM. */ private void dispatchUncaughtException(Throwable e) { getUncaughtExceptionHandler().uncaughtException(this, e); } //============================== import ch.ntb.usb.Device; import ch.ntb.usb.LibusbJava; import ch.ntb.usb.USB; import ch.ntb.usb.USBException; import ch.ntb.usb.Usb_Bus; import ch.ntb.usb.Usb_Config_Descriptor; import ch.ntb.usb.Usb_Device; import ch.ntb.usb.Usb_Device_Descriptor; import ch.ntb.usb.Utils; try{ size_readD=dev.readBulk(0x82, readData_byte, DATAWORDX*4, 500, true);   //size_readDはゼロにはならず、特別な割込みが発生します } catch (USBException e) { System.out.println("readBulk_Error_PLR(USBException): size_readD="+size_readD); System.exit(1); } if(size_readD==0){ //このコードは機能せず System.out.println("size_readD="+size_readD); break; } //===========================

Viewing all articles
Browse latest Browse all 2439

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>