Thanks Dan,
Soon after I sent the message I realised that "reset" is a PTP command, not a 
USB command - sorry.  I chose it as simple, one way command that (hopefully) 
wouldn't affect the camera too much.
I see the examples are back up on http://javax-usb.org/ so I'll see if I can 
make some progress by looking at them.
 
Regards
Jeff Owen

________________________________

From: [EMAIL PROTECTED] on behalf of Dan Streetman
Sent: Tue 15/11/2005 20:09
To: Jeff Owen
Cc: javax-usb-devel@lists.sourceforge.net
Subject: Re: [javax-usb-devel] Help required: Examples Please




On Tue, 15 Nov 2005, Jeff Owen wrote:

>Ultimately, I want to monitor and control a Nikon D-70 camera and I am
>using Jphoto as inspiration, which uses the jUSB code.  However, that
>project seems to be a bit inactive and so I found JSR-080 and this
>project.  I thought I'd start off simply by trying to send a reset to
>the camera, however, it all looks a bit impenetrable without an example.

Funny you want to start off with a "reset".

Unfortunately, the USB specification _does not_ define any "reset"
command.  You CANNOT reset any USB device with a standard command.  In
fact, the only universal way to reset a USB device is to reset (disable)
the port that the device is connected to.  To do this, you have to send a
command to the hub that owns that port.  And that hub (i.e. all hubs) are
always controlled by the OS's hub driver.

So the short answer is that you _can't_ reset a USB device in a universal
way.  Many (or some, at least) devices have proprietary reset commands, if
yours has one then use that.  If not, some OSes provide reset mechanisms,
but it's entirely up to the OS, and frequently that reset mechanism is
unreliable or unsafe.  Linux, for example, does provide a reset ioctl in
its usbfs (which javax.usb uses), however the call is NOT safe to use for
all devices, in fact it's liekly that it's not safe to use for any device
(specifically if a device has multiple interfaces that are driven by
different drivers it's completely unsafe to use the usbfs reset ioctl, at
least in some kernel versions).

Hmm, that question should probably be in the FAQ...I'll add it.



--
Dan Streetman
[EMAIL PROTECTED]
---------------------
186,272 miles per second:
It isn't just a good idea, it's the law!

_____________________________________________________________________
This e-mail has been scanned for viruses by MCI's Internet Managed Scanning 
Services - powered by MessageLabs. For further information visit 
http://www.mci.com



_____________________________________________________________________
This e-mail has been scanned for viruses by MCI's Internet Managed Scanning 
Services - powered by MessageLabs. For further information visit 
http://www.mci.com


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_idv28&alloc_id845&op=click
_______________________________________________
javax-usb-devel mailing list
javax-usb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/javax-usb-devel

Reply via email to