|
From: Linus W. <lin...@gm...> - 2008-02-17 20:56:59
|
2008/2/17, Ali Shah <ca...@gm...>: > Opening from the raw device structs can be accomplished by doing a > prime_device_memory, assign_known_device_flags, configure_usb_device etc on > the singular device only. Yep. > 1) The client application will need to be notified via HAL/DBUS when a > device has been disconnected/connected > 2) Its not completely clear how we HAL detections to the libusb raw devices. Yep. We cannot move that into libmtp, because the Mac and "other" OS:es doesn't have HAL+D-Bus, and even if they did, it'd be a bit thick to require that. I do not know if libusb supplies some marker that can be used to match the HAL info, sadly. However, I don't think it matters so much, we rescan the list when we get a HAL callback, then we notice a new device was connected. We do likewise when we get a HAL disconnect callback, and close (Release) devices accordingly. > 3) unfortunately this method does not give alot of information to the > client application, besides, here is a list of raw devices, please pick from > one.. HAL actually give the manufacturer+device ID as strings. If we can match these informations, we'd be home. Otherwise, we can get the USB-level device name if there is one. Else a dialog of the type "a new media device was connected, open an MTP session to it?" is acceptable I believe. Linus |