Consuming a USB HID device in Windows CE 6.0 using C# - c#

I am working on an embedded Windows CE project and am interested in accessing a USB HID device through one of its USB Host ports. All I really need to read are the raw HID specification packets.
On a Windows computer, I have a working program using hid.dll, but as far as I have researched, there isn't any equivalent on Windows CE. I know there is the usbhid.dll file, but I'm not sure if it is applicable for this situation. I would prefer not to write a kernel level driver, as I would like to do my coding in C#. How can I make consuming an HID device on Windows CE work?

I have no concrete experience with HID, but accessing the USB port as a COM port with a proper driver DLL (the device manufacturer might have one) might help. Theoretically you should be able to receive the device's raw data packets with a SerialPort class that way.

Toradex released their USB sensors and peripherals as open source.
The sensors are HID devices and the freely available source code does include samples for C# and Visual Basic on Windows CE.
Oak Sensors and Interfaces

Related

Using USB bulk transfer for data acquisition

Below I have included information about the specific microcontroller and library I am using for the microcontroller only to provide a little context and in case someone has experience with them. I am really looking for some broad answers about USB bulk communication vs other USB styles of communication.
I am developing a UWP based app to communicate with a TI TM4C based microcontroller. The microcontroller has several analog and digital sensors which need to be transmitted and logged/displayed in the application.
I would like to use the WinUSB.sys driver for USB communication with the device because I have read about a lot of problems with the usbser.sys driver and I want to avoid using System.IO.Ports namespace because of well documented issues with event reliability. The WinUSB driver would allow me to use the Windows.Devices.USB namespace instead.
The communication structure I am envisioning between the application and the device would be simple requests for data from the application and the device sending the contents of its data registers (<50 bytes). Other commands from the application would set certain output values manually and would anticipate an acknowledgement from the device that this was done successfully or any error that occurred.
TI provides a bundled library for the microcontroller called TivaWare USB Library
1) Does anyone foresee any issues using bulk transfers for communication between the application and the device? Particularly, I was concerned with this description of bulk transfer found in the Windows Documentation "Therefore, when the bus is busy with other transfers, bulk data can wait indefinitely."
2) Bulk transfer is described as having error detection and retries baked in. Does this mean using other methods I would need to implement some kind of error detection for data transmitted like a CRC?
3) This page describing using WinUSB with UWP apps seems to imply that the WinUSB driver can be used with a CDC device class, does this mean that I can communicate with a CDC class device with the Windows.Devices.USB namespace or am I still stuck using System.IO.Ports since CDC devices expose virtual com ports? (At least when using the USBser.sys driver. Does it work the same with the WinUSB driver?)
We ended up using the TivaWare library keyboard example to help us build our own HID device and write custom HID report descriptors. C# UWP does indeed have excellent support for HID devices and we used the humaninterfacedevice library. The TivaWare library is difficult to work with if anyone is considering going down the same path.

Windows 8.1 Universal Store App connect to COM port

I'm currently writing a code in C# that would allow the user to read from the usb COM port (I currently have a microcontroller feeding it constant values to the usb port through serial print) and print it to the output of visual studio.
I've been reading up on a lot of documentation, specifically the MS's guide to conecting to USB:
https://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn312121.aspx#step1
but I'm now finding that the USB device isn't supported.
However, would it be possible to simply read from the Serial port instead of entirely connecting the USB device to the project?
Since it's a Store App, I can't use Serial.IO.Ports

Send Bar code from android app to C# desktop application via usb cable

Is it Possible that I can send bar code value from android application to my C# desktop application via Usb Cable.
I just want to link my two applications via usb cable .. I have searched a lot but still failed..
You should try to use those libraries:
SharpUSBLib
LibUsbDotNet
They allow to communicate with USB port via C#, and you will be able to read data from USB port in your C# application. Then you need to implement the sending part in your Android application. There is a package android.hardware.usb on Android side which contains functionalities for communicating with USB ports. You can use classes from this package to handle the communication.

How to read data from I2C

I want to read data from an I2C device in windows XP, but i am beginner in working with serial ports and I2C devices.I have searched a lot however i have just found some codes to write on an I2C device but not read from it.please describe me how should i start?
Edit: I have an I2C device, an I2C to USB convertor and a USB cable.I have connect them together with this sequence:
The I2C device is connected to I2C-USB convertor with a cable and the convertor is connected to the USB cable finally the USB cable is connected to my computer system.
by the way i have using Windows XP on my system.
I have a very similar situation. However, my USB-to-I2C device came with a C library, so my code simply has to execute i2c_read() or i2c_write() functions. Then the library takes care to talk to the driver, then the USB-to-I2C device and so on. It is pointless for me to give you the code that I use because we have a custom device and custom library (made specifically for my company).
Since you have the "write" example, there should have been the read functionality as well.
Since you did not provide any particulars on which USB-to-I2C device you have, this is all the information that can be provided.

Create a virtual serial port for widcomm stack under 32feet

Currently I am doing a project involves a bluetooth communication setup between a PDA and a small embedded device. This small embedded device can only be communicated with a virtual serial port over a bluetooth link.
The PDA is the ipaq running with windows mobile 6, and I am using c#.
I had done a program which can communication with the serial port over bluetooth. But the only issue is every time I run this program, I have to active the bluetooth radio, and manually pairing this device with the pda via the bluetooth manager. What I want to do is when running this program, it can establish the bluetooth connection between the pda and the embedded module.
So I am using functions from the 32feet prject. This is one issue is I cant make the virutal serial port part, as I think the 32feet project can only make virual serial ports for the window bluetooth stack but not the widcomm bluetooth stact, which the ipaq is using.
Therefore, are there any existing c# classes or stacks that can make virtual serial port under widcomm for windows mobile 6.
Thanks
See my answer at Widcomm bluetooth : how to open the virtual COM. I generally recommend using a direct sockets (BluetoothClient) connection. That seems better to me than having to create a virtual serial port, which is difficult on various platforms, and then open it, and then gets no errors when the peer device goes out of range etc etc. :-)
Alan

Categories

Resources