Re: [Libphidget-devel] libphidget newbie post...
Status: Alpha
Brought to you by:
jstrohm
|
From: <fit...@ph...> - 2003-06-29 16:04:31
|
Hi Tom, jack, vadim,
> sorry, I have that (the protocol). I just didn't expect the
> behaviour I got from the system for a buffer size mismatch.
> AFAIK, I'm pretty much homefree from here, the rest should be
> pretty trivial... just a case of finding another block of 5
> hours...
It's not just a buffer mismatch; it's the length of the packet.
> While I'm here, my system isn't showing an output endpoint for
> the 888 card... I don't have anything to compare it to... hhmm,
> ok, it looks like we don't have a separate endpoint, e.g...
>
> if (_isSoftPhidget(phidgetType(phidgetDevice))==0)
> {
> // If this isn't a soft phidget we use control messages so
> ret=usb_control_msg(phidgetDevice->handle, 0x21, 0x09, 0x200, 0,
> buffer, size, 5000);
> }
> else
> {
> // Only works for writing to soft phidgets
> ret=usb_bulk_write(phidgetDevice->handle, 0x01,
> (void *)buffer,size, 5000);
> }
>
> Is that conclusion/guess correct? The digitout outputs are
> controlled with a control message?
Very good.
> is there somewhere were these magic constants like
> "0x21, 0x09, 0x200" and the ones used to obtain the serial number
> are described?
These are all HID commands. 0x21,0x09,0x200 is a SetReport packet.
http://www.usb.org/developers/hidpage/
Chester
|