5.4 Updating the USB Dongle
The NIMMSTA USB Dongle is needed on Linux in order for the Core Library to work. Also on Windows, if it is connected, it is the preferred way of connecting to the devices.
In order to update the USB dongle, you need to decide when to do it as during that time, no connections or device discovery is possible.
We recommend to do it when the application is started and before any other NIMMSTA related code is executed.
The following code snippet shows how to update the USB dongle:
````Kotlin fun main() { val connectionManager = ConnectionManager()
// check for dongle update
connectionManager.checkForDongleUpdate().onComplete {
// init your application
}
// Prevent app from exiting
while (true) {
Thread.sleep(10)
}
}
````
````Java class Main { public static void main(String[] args) throws InterruptedException { ConnectionManager connectionManager = new ConnectionManager();
ConnectionManager connectionManager = new ConnectionManager();
connectionManager.checkForDongleUpdate().onComplete(new TaskCallback<Unit>() {
@Override
public void run(@NotNull Task<Unit> task) {
// init your application
}
});
// Prevent app from exiting
while (true) {
Thread.sleep(10);
}
}
}
````