====== API changes in releases 20160129 and 20160818 ====== ===== 20160818 changes ===== In this release old LibusbJava/libusb-0.1 was replaced by usb4java/libusb-1.0. This required major changes in the source code of the API. The interface changes are kept small but host software has to be ported to usb4java too, see [[en:software:using_libusb]]. Parameter set changes of methods are not described here. See the [[http://www.ztex.de/firmware-kit/docs/java/index.html|API documentation]] if the compiler produces errors. ==== General changes ==== A few changes are required in the source code of the host software * Replace import ch.ntb.usb.*; by import java.nio.*; import org.usb4java.*; * Remove ''LibusbJava.usb_init()''. Now new USB contexts are usually created automatically by [[http://www.ztex.de/firmware-kit/docs/java/ztex/ZtexScanBus1.html|ZtexScanBus1]]. * [[http://www.ztex.de/firmware-kit/docs/java/ztex/ZtexScanBus1.html#unref()|ZtexScanBus1.unref()]] should be called as soon the instance is not needed anymore * [[ http://www.ztex.de/firmware-kit/docs/java/ztex/Ztex1.html#dispose()|Ztex1.dispose()]] should be called as soon soon the instance is not needed anymore. (Remember that ''Ztex1'' is the superclass of ''Ztex1v1''.) * Byte arrays ''byte[]'' should be replaced by ''ByteBuffer'''s in order to benefit from improved Java NIO performance. ==== Helpers ==== Certain helper methods and classes simplify usage of synchronous and asynchronous transfers: * [[ http://www.ztex.de/firmware-kit/docs/java/ztex/Ztex1.html#bulkRead(int, java.nio.ByteBuffer, long)|Ztex1.bulkRead(..)]] and [[http://www.ztex.de/firmware-kit/docs/java/ztex/Ztex1.html#bulkWrite(int, java.nio.ByteBuffer, long)|Ztex1.bulkWrite(..)]] can be used for syncronous transfer. (Avoid the byte array variants. The will be marked as deprecated soon.) * [[http://www.ztex.de/firmware-kit/docs/java/ztex/Ztex1.html#allocateByteBuffer(byte[])|Ztex1.allocateByteBuffer(...)]] Creates ''ByteBuffer'''s and initalizes them with content of a byte array. * Helper class for asynchronous transfers, see the ''memfifo'' example for a demonstration of their usage * [[http://www.ztex.de/firmware-kit/docs/java/ztex/ZtexEventHandler.html|ZtexEventHandler]] implements an event handling thread * [[http://www.ztex.de/firmware-kit/docs/java/ztex/ZtexUsbReader.html|ZtexUsbReader]] implements asynchronous bulk and interrupt read transfers * [[http://www.ztex.de/firmware-kit/docs/java/ztex/ZtexUsbWriter.html|ZtexUsbWriter]] implements asynchronous bulk and interrupt write transfers ===== 20160129 changes ===== This is the first release with FX3 support. There are a few minor API changes: * class Name changes: * IhxFile -> [[http://www.ztex.de/firmware-kit/docs/java/ztex/ImgFile.html|ImgFile]] * ZtexIhxFile -> [[http://www.ztex.de/firmware-kit/docs/java/ztex/ZtexImgFile1.html|ZtexIhxFile]] * IhxParseException -> [[http://www.ztex.de/firmware-kit/docs/java/ztex/ImgParseException.html|ImgParseException]] * ImgFileDamagedExceptio -> [[http://www.ztex.de/firmware-kit/docs/java/ztex/ImgFileDamagedException.html|ImgFileDamagedException]] * method changes in [[http://www.ztex.de/firmware-kit/docs/java/ztex/Ztex1v1.html|Ztex1v1]] * Ztex1v1.eepromUpload -> [[http://www.ztex.de/firmware-kit/docs/java/ztex/Ztex1v1.html#nvUploadFirmware(ztex.ZtexImgFile1, boolean)|nvUploadFirmware]] * Ztex1v1.eepromUpload -> [[http://www.ztex.de/firmware-kit/docs/java/ztex/Ztex1v1.html#nvDisableFirmware()|nvDisableFirmware]]