0

We've got two WinCE devices that need to talk to each other, they don't have WiFi or Bluetooth so I think a wired USB connection is our best chance. I've been reading up on using ActiveSync and serial over USB, but all the articles are geared towards talking between a WinCE device to a full Windows box, never between two WinCE devices.

If we can get ActiveSync working, that's fine, the other option is just to open COM ports on both sides and write our own communications protocol.

Given the project timelines, writing any sort of device driver isn't an option, this needs to be something that is built in to WinCE.

We are building WinCE for both devices, so I can make any modifications necessary at that level.

Is there a way to get these two guys talking to each other?

Betty Crokker
  • 3,001
  • 6
  • 34
  • 68
  • *"but all the articles are geared towards talking between a WinCE device to a full Windows box, never between two WinCE devices."* That's because there are two types of USB ports: host and device (aka gadget). If your WinCE devices only have USB device ports, then you cannot connect two USB device ports to each other. You need to connect a USB device to a USB host. – sawdust Jan 14 '15 at 18:35
  • I'm trying to find out the details on the USB ports on the two devices, but it seems very likely that the ports are OTG. This is because we can plug in a USB stick and the WinCE device mounts it as an external drive, but we can also plug the WinCE device into a Windows machine and the WinCE's drive appears as an external drive to the Windows machine. – Betty Crokker Jan 14 '15 at 20:26
  • If a USB memory stick works then you have an OTG port. – PaulH Jan 14 '15 at 20:37
  • If you can use one OTG port in host mode and the other OTG port in gadget mode, then configure the gadget side to act as a [CDC/ACM device](http://en.wikipedia.org/wiki/USB_communications_device_class) – sawdust Jan 14 '15 at 20:40
  • That sounds great to me, but I have -zero- idea how to do such a thing. Any suggestions? Thanks! – Betty Crokker Jan 14 '15 at 20:56

1 Answers1

0

If you can't write your own driver then your fastest route is probably to get a USB to serial converter for both devices and then connect them via serial.

Obviously, you'll need to choose one that has support for Windows Mobile. I think FTDI based adapters should work.

Once that's working you just use the built-in serial API to read and write data.

PaulH
  • 7,759
  • 8
  • 66
  • 143
  • A USB-to-serial converter is intended to connect to a USB host port. A WinCE device may not have a USB host port. – sawdust Jan 14 '15 at 18:37
  • It is not unusual for a WEH or WEC device to have a USB OTG port. I'm assuming OP's device has one. If not, you're correct, there is no way to do what he wants. – PaulH Jan 14 '15 at 19:45
  • The USB-to-serial converter is a great idea, I will definitely pursue that. However, I'm also still confused about why that's necessary. When I build WinCE, one of my options is SYSGEN_USBFN_SERIAL which we have enabled, that would seem to imply that the USB is already capable of talking serial - which is the transport layer for ActiveSync? Doesn't that imply there is already some sort of driver on the WinCE device to let it communicate in some sort of serial manner? – Betty Crokker Jan 14 '15 at 20:29
  • Perhaps, but that involves a separate driver which you said you did not have the time to create. The advantage of USB-to-serial converters is that somebody has already made the driver for you. – PaulH Jan 14 '15 at 20:39
  • I want to make sure we're talking about the same "driver". If there is a COMx: port available (which gets converted into USB signals) I am happy and will take it from there. Are you saying that just setting SYSGEN_USBFN_SERIAL is not enough to have Windows include a driver that gives me COMx: access to the "USB as serial" interface? – Betty Crokker Jan 14 '15 at 20:55
  • And I will have to update a previous comment I made - management is not happy about what it would cost to include 2 USB-to-RS232 converters with each setup. They REALLY want me to figure out how to do this in software only (plus one simple USB cable). – Betty Crokker Jan 14 '15 at 20:58
  • Another random thought: Is it possible to connect two WinCE devices using ActiveSync? There is definitely a slave-side ActiveSync driver on WinCE, but I'm not sure if there's a master-side driver ... – Betty Crokker Jan 14 '15 at 21:13
  • *"management is not happy..."* -- The solution of using two USB-to-serial adapters is not practical. A solution of just a cable is possible, but it might be a custom cable (I just don't know; I've never tried an OTG to OTG connection). Besides the cable there's the software component of the solution. Perhaps you need to prepare a presentation for management that points out that this isn't a trivial connection. It's like the question of connecting 2 PCs using USB; you need a special adapter/cable to do that. – sawdust Jan 14 '15 at 21:15
  • You can do this with just a USB cable. (although sawdust makes a good point that it may be a weird cable. I'm not sure; you'll need to research that). To do it, you do what ActiveSync does: create a [USB function driver](http://msdn.microsoft.com/en-us/library/ms923750.aspx) for your protocol. – PaulH Jan 14 '15 at 21:19
  • Also, I should mention this is somewhat dependent on whether your USB driver will support its OTG port talking directly to another OTG port. It might not. – PaulH Jan 14 '15 at 21:25
  • Interesting ... when I follow your link for "USB function driver" and poke around a little, I get to a page (http://msdn.microsoft.com/en-us/library/ms895495.aspx ) that says "Microsoft provides hardware platform independent USB function client drivers for RNDIS, serial, and storage." I'm not sure what that means, if it doesn't mean "Microsoft provides a USB-to-serial driver" ... – Betty Crokker Jan 14 '15 at 21:32