Serial port support

I am trying to attach the serial port 1 of the emulator to the GPS receiver connected to my desktop. I can either use USB or Bluetooth GPS receivers, and they work fine on the desktop. However I can't seem to get it to work on the emulator
USB: setup works (can select port) but no data is transmitted

Bluetooth: COMport cannot be opened, setup fails.
Are you saying that only plain old serial GPS receivers connected to COM1 on the desktop are supported? Didn't they stop producing serial GPS receivers a decade ago?

[530 byte] By [lbendlin] at [2008-1-25]
# 1
In order to use a Bluetooth receiver, you'll need to map a COM port to the receiver on your host PC first, and then map this to a virtual port on the emulator. Note also that only one device can be connected to the receiver at once, so make sure you don't have any desktop software using the receiver.
Once you have a COM port mapped to the GPS receiver e.g. COM6, you'll need to set this up in the emulator properties and map it to one of the three slots on the emulator (0,1 or 2). I found when I last used it that in order to open a device mapped to COM0 I had to use COM1: in software on the emulator, so these are possibly mislabelled

Peter

PeterFoot at 2007-9-8 > top of Msdn Tech,Smart Device Development,Device Emulator General...
# 2
That indeed seems to be the case. "Serial Port 0" is in reality COM1: on the emulator.
All working fine now - thanks a lot.
lbendlin at 2007-9-8 > top of Msdn Tech,Smart Device Development,Device Emulator General...
# 3

The 0 refers to UART0. When I was making the dialog I numbered them in correspondence to which UART they respresented, but it seems that COM port mapping is a better idea. I'll address that.

Thanks,

Vladimir

VladimirFedorov at 2007-9-8 > top of Msdn Tech,Smart Device Development,Device Emulator General...
# 4
Looks like I have to eat my words. It does work with a USB GPS receiver, but not with a Bluetooth receiver. Whatever I do, I always get

Unable to open serial port 'COM17'. LastError=The system cannot find the file specified.
.
(Note the extra period after the message)

The BT GPS works fine when accessed from HyperTerminal. Any ideas?

lbendlin at 2007-9-8 > top of Msdn Tech,Smart Device Development,Device Emulator General...
# 5
I am assuming that you bound COM17 to one of the UARTs in Configuration\Peripherals - let me know if that's wrong. In that case it means that:

hCom = CreateFileW("COM17", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);

returned INVALID_HANDLE_VALUE. This typically happens if the port is open by another application or another instance of DE.

Thanks,

Vladimir

P.S. The extra "." was fixed for RTM. It was a result of embedding a GetLastError explanation within a custom error message.

VladimirFedorov at 2007-9-8 > top of Msdn Tech,Smart Device Development,Device Emulator General...
# 6
Yes, I did bind COM 17 to "Serial Port 0" . I made sure no other program on the PC is using the port.

Can you explain why this works for a USB receiver but not for a Bluetooth receiver? They are both emulating serial ports on the PC, so I would have thought they should work the same.

(NB: I am using the XP SP2 Bluetooth stack which doesn't support "connecting" (as opposed to the WidComm stack) so applications have to connect themselves. With Widcomm you can connect the OS to the receiver and then fire up the application to use the opened connection. I'd like to avoid having to install the Widcomm stack because I don't need any of the other Bluetooth services on my development desktop.)

lbendlin at 2007-9-8 > top of Msdn Tech,Smart Device Development,Device Emulator General...
# 7

I am not sure, but my guess would be - something related to the COM port configuration. One thing to try is to create a small app which simply tries to open the COM port with the same options as I listed in the previous post and see if it fails.

I'll try to setup a machine and take a look. I'll have to steal a Bluetooth receiver somewhere :)

Thanks,

Vladimir

VladimirFedorov at 2007-9-8 > top of Msdn Tech,Smart Device Development,Device Emulator General...
# 8
Volodya,

did you have any luck with the BT dongle? Can I help with the testing?

Lutz

lbendlin at 2007-9-8 > top of Msdn Tech,Smart Device Development,Device Emulator General...
# 9

I have not gotten the dongle yet. I'll check on the request to see what is going on.

Thanks,

Vladimir

VladimirFedorov at 2007-9-8 > top of Msdn Tech,Smart Device Development,Device Emulator General...
# 10
In the meantime I have tried with the Widcomm/Broadcomm stack, and that one works like a charm. The difference to the Microsoft stack is that with Broadcomm you can explicitly and manually connect to a BT SPP device, while the Microsoft stack is doing that "automatically" (read: not at all). A bit of a shame really, but at least there's a workaround.
lbendlin at 2007-9-8 > top of Msdn Tech,Smart Device Development,Device Emulator General...
# 11
i have a problem binding COM2 [serial port 1:] on emulator to virtual com port COM4 on the desktop.

Emulator doesn't show COM4 in the list (it shows only physical ports).
I've tried to type COM4 in the text box but in runtime i get message "The port 'COM2:' does not exist."

Any ideas?

virtual COM4 is created by GPS Emulator (GpsGate)

Same code but for Windows Application (serial port assigned to COM4) run without any problem.

DaNet at 2007-9-8 > top of Msdn Tech,Smart Device Development,Device Emulator General...
# 12

COM2 is assigned to serialPort component in Form (Design),
and COM4 is assigned to [serial port 1:] field in Emulator settings..
Is it right way?

I also tried COM1 in the Form, but Emulator froze dead and only reset would bring it back to life..
P.S. Before I could bind to the same COM4 with Pocket PC 2002 emulator and VS2003 ..

another strange thing is that changing Emulator settings in VisualStudio doesn't change the same settings accessed from Emulator menu and vica versa..
(at least, Com port settings)

DaNet at 2007-9-8 > top of Msdn Tech,Smart Device Development,Device Emulator General...
# 13
I have a usb BT adaptar and are using the BlueSoleil bluetooth interface. I open a port on COM14, works with Hyperterminal fine, and I also can't connect through the emulator which would be very helpful to be able to do so in testing with a BT gps. I get the cannot find file specified error.Tongue Tied
Adiraz at 2007-9-8 > top of Msdn Tech,Smart Device Development,Device Emulator General...
# 14
FWIW, you may also want to check this thread:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1134808&SiteID=1

I found that with a COM port less than 10, the Microsoft stack does work - but with COM10 or greater, neither will work, so installing Broadcom proved to be barking up the wrong tree.

I realize this is an old thread I bumped, but it was one of very few results I got in searching for this error myself - so I figured adding the cross-reference might be helpful.

luidia.mk at 2007-9-8 > top of Msdn Tech,Smart Device Development,Device Emulator General...