Probably not, although it helps enormously to know what you are actually trying to do.I am trying to develop code for an 8-bit PIC microcontroller (12F675) using a PICKit 1 Flash Starter Kit (only $36). My microcontroller application does not involve USB, but the starter kit has a USB interface for programming the microcontroller. All the software to program the microcontroller runs under windows. I want to program it under Linux instead.
The documentation that came with the kit says the basic programming interace is to send 8 byte packets full of commands to the development board, and the board will return data to the PC. For example, the 'v' command returns the programmer firmware version and the 'Z' command is a null command. To determine the firware version, I need to send a packet with 'vZZZZZZZ' from the PC to the development board. The development board should respond with a packet that has the version. There are also commands to read and write program and data memory.
So basically I need to know how to send an eight byte packet to the microcontroller and read data it returns. Today I found an application note that gives a few more details about the USB implementation on the development board. It says the interface to program the microcontroller is on endpoint 1. There is also visual basic source code for the windows application that programs, the chip, and assembly for the firmware. I'll take a look at it to see if I can figure out what it is doing and how that relates to the Linux HID interface...
The code runs, but the (appl > 0) test fails because the ioctl returns 0xff000001, so the switch statement never gets executed. Changing appl to be unsigned would make this particular case work, but would give bad results when the ioctl fails, becuase it will return -1. When appl is unsigned, -1 is really 0xffffffff. My problem will only happen when the application id is one of the vendor devifed ids (0xff00 through 0xffff). Most "normal" hid devices probably don't do this.Probably I blundered, and should have made appl unsigned. However you have messed up my code. Does it run if you use the code unmodified?Also I came across a small problem when trying the HIDIOCAPPLICATION ioctl example. The example code calls the ioctl and tests the return value like this:
appl = ioctl(fd, HIDIOCAPPLICATION, yalv);
if (appl > 0) {
printf("Application %i is 0x%x ", yalv, appl);
/* The magic values come from various usage table specs */
switch ( appl >> 16)
[...]
Brad
Bill.
------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-users