Accessing Host USB in Windows Mobile 5.0 - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Accessing Host USB in Windows Mobile 5.0

Hello!

I try to access a HID USB device with my PocketPC LOOX with integrated USB Host.

I already figured out - that I can get an handle to the device with -> FindFirstDevice, FindNextDevice
I am quite sure I got the _right_ device, because I looked at the enumeration before an after I plugged it in.
The device name in the DEVMGR_DEVICE_INFORMATION is HID1.
I assume this also means the HID driver was loaded.

To make sure opening is made with the correct options - I do a

HANDLE hFile = CreateFileW(di.szDeviceName,
GENERIC_WRITE | GENERIC_READ,
FILE_SHARE_READ|FILE_SHARE_WRITE,
(LPSECURITY_ATTRIBUTES)NULL,
OPEN_EXISTING,
0,
NULL);

No error occurs, and I see a value for hFile.

Now I try to write and read from the handle with

...
Result = WriteFile(handle, &WriteBuffer, 10, &BytesWritten, NULL);
...
or
ReadFile(handle, &ReadBuffer, 10, &NumberOfBytesRead, NULL);

of cource with the right Buffer / Bufferlenght handling.

WriteFile and ReadFile does not work an come with error 50 (ERROR_NOT_SUPPORTED).

Does not seem right

So I tried to deal with DeviceIoControl .. and got no luck.

On Windows XP everythink work fine (HidD_GetPreparsedData, HidP_GetCaps, SetupDiGetClassDevsW, SetupDiEnumDeviceInterfaces, SetupDiGetDeviceInterfaceDetailW, CreateFile, ReadFile, WriteFile) but this functions does not seem to be available in Windows Mobile 5.0 (hid.dll, hidsdi.h, setupapi.h ...)

If you wonder which device I want to control ... here you go .. JoyWarrior 24F8 from www.codemercs.com

Can anyone point me to the right function to access / read / write an HID USB Device in Windows Mobile 5.0.
It does not matter if VB, VC++,C or C#

Comments

  • funkyjayfunkyjay Posts: 1Member
    hi,

    did you find a solution in the meantime?
    i have the same problem but i can't find my HID device.

    are there soem places in the registry where the enumeration is stored when i plug the device in? i even do not know if the device was recognized by WIN CE.
    on WIN XP all works fine :(
Sign In or Register to comment.