manuelbl / JavaDoesUSB

USB library for Java
MIT License
140 stars 11 forks source link

Unmount an USB sdcard (soft) do no trigger a disconnected event #17

Closed ouaibsky closed 9 months ago

ouaibsky commented 12 months ago

Event are well received when I plug an sd card.

But when I un-mount (click into the finder on the icon) then no event is received (setOnDeviceDisconnected).

Event (disconnected) is received only when I physically remove the sdcard.

Is it something expected ?

manuelbl commented 12 months ago

This is to be expected. Unmount is a file system operation. After unmounting the device can no longer be accessed through the file system. But it is still available, e.g. for formatting. And it can be mounted again.

Furthermore for composite devices, unmounting only affects the mass storage part while the other functions (e.g. a serial port) are still in use.