Hello,
does anyone know how to use the Core Connectivity API to connect to running devices/emulators
I am using the new Microsoft.VisualStudio.DeviceConnectivity.Interop assembly but am not able to connect to emulator instances that where started from the commandline. These instances are however visible in the Device Emulator Manager under the item "Other".
Thanks in advance,
Peter Vrenken

Use the Core Connectivity API to connect to running devices
CSSMr.Smith
To connect to a device you need to have an entry for that device in Datastore. Since the emulator that you started from commandline will not have an entry in datastore you will not be able to connect to the emualtor using Core Connectivity API.
madda
Mohit,
i am (was already) able to start multiple emulators using commandline arguments, but by doing so am not able to connect to them using the API (for file uploading/executing etc.).
The CeEnum demo application available from the OpenNETCF website shows how to connect using the API to a single emulator/device, but i failed to modify it to start multiple emulators, even after experimenting with server (VMID ) guids like you said.
The API isn’t fully documented so experimenting with the different objects and their method involves allot of trial and error.
In my last attempt i took the following steps (and failed):
The result was that one single emulator is started, and when instantiating and connecting to a second ICcServer just the old one is connected to…
You see i made allot of assumptions, but there is nothing to build from, so does anybody have an example or decent documentation of the API
Thanks allot from the rainy Netherlands,
Peter Vrenken
Doomgrinder
RichBond007
Hi,
Launching multiple emulator instances of the same type and connecting to is a bit involved.
First remember that every emulator instance is identified by a VMID. VMID is associated with emulator. For example PPC03 emulator will have a VMID specified in the datastore. When you try to connect to PPC03 emulator specifying its <platform Guid, Device Guid>, internally corecon uses the VMID to connect to the right emulator instance.
Here are the steps.
1. Say that you want to connect to 2 instances of PPC03 emulator. Using the standard entry present in datastore, you can connect to one instance.
2. To connect to another instance, you need a separate device entry in datastore with a different DeviceGuid and VMID. One simple way out is to use "Tools->options->device options->save as" to clone an existing standard device. This will create another device entry in datastore under PPC03 platform with a different device Guid and VMID. Opening datastore file "conman_ds_platform.xsl" you can find out the device GUID of the new device.
Doing this programatically is involved, and you need to use lots of datastore apis to create a new device entry.
3. Now you can connect to the second instance of PPC03 emulator by specifying the new device Guid.
4. In summary if you need to connect to N emulator instances of the same type, you need that many datastore entries with a different device guid and vmid.
5. Once you are done, you can delete them through "tools->options->device options->delete". Deletion can also be achived programatically using datastore API.
Thanks
Siva
Greg Rutherford
Thanks for the quick response. In my search i came to the conclusion that the Device Emulator Manager application showed the total hierarchy of the datastore, but i guess that's totally wrong. I got to this conclusion by the fact that the Device Emulator Manager also shows emulators that are executed from the commandline.
So i guess the best approach is to start the emulator from the API, but then there is no information available about how to configure and start multiple instances of the same emulator.
Any clue on how to achieve this
Peter Vrenken
dribar
Hello Peter,
Every running instance of device emulator gets registered in the Running Object Table using the VMID passed passed to it (I nothing is passed it generates on its own). So if you want to start multiple instance of the same emulator, start from command-line/API passing different VMID.
You may want to go through this post which give a good overview of the VMID parameter for the device emulator http://blogs.msdn.com/barrybo/archive/2005/08/31/458497.aspx
Hope this helps.
-Thanks,
Mohit
SpeedyBoy
Thanks for the info!
I'll try it as soon as i've got time...
Peter Vrenken