Freigeben über


What is Corecon-lite?

So as promised, first in the series of discussions for Device Emulator V3 features is Corecon-lite. In short Corecon-lite adds capability for managing your custom emulator images (or custom emulator configurations) using Device Emulator Manager even if you don't have Visual Studio installed. This is especially useful in scenario of Marketing folks who want a very light weight installation of custom emulator configurations to show demos.

For this feature we need to understand the concept of response files to Device Emulator (called as DECFG files) and some special directories where storage of these decfg files will lead to lighting up of custom emulator configurations in Device Emulator Manager view.

 Response Files to Device Emulator:-

In Device Emulator v3.0, we added the capability that Device Emulator can take response file in addition to usual way of passing command-line options. So suppose we have a response file named PocketPCBatteryEnabled.decfg file which contains the configuration of the emulator, we want emulator to start with, we can invoke following command-line

deviceemulator.exe "@PocketPCBatteryEnabled.decfg"

These response files are named as decfg files and schema for the same is discussed in Appendix1. One sample decfg file is

<?xml version="1.0" encoding="utf-8"?>

<!-- Comment -->

<DeviceEmulator xmlns="https://schemas.microsoft.com/DeviceEmulator/2006/01/DeCfg">

<Platform>Windows Embedded CE 6.0</Platform>

<Emulator>

<VmName>DecfgDeviceEmlator</VmName>

<Language>1033</Language>

<AlwaysOnTop>true</AlwaysOnTop>

<VMID>{bc8ea444-9068-48c3-8f03-e7b0c333d97f}</VMID>

</Emulator>

<Board>

<OSImage>%programfiles%\Microsoft Visual Studio 9.0\SmartDevices\emulators\images\pocketpc\2003\1033\PPC_2003_SE_WWE_ARMv4.bin</OSImage>

<MemSize>128</MemSize>

</Board>

<Peripherals>

<SharedFolder Enabled="true">c:\</SharedFolder>

<Battery Charge="80"/>

</Peripherals>

</DeviceEmulator>

If you will use this response file to DE, it will launch emulator with Shared-folder mapped to "c:\" and battery being enabled with charge @80% and name of "DecfgDeviceEmulator".

Special Directories DEM recognizes as Corecon-lite directories:-

Device Emulator Manager looks in two special directories - "CSIDL_PERSONAL\My Device Emulators" and "CSIDL_COMMON_DOCUMENTS\All Device Emulators" - for the presence of any .decfg files as discussed above and displays them in Device Emulator Manager view under a root level node named {All Device Emulators, My Device Emulators}. So if you named the above decfg file to be "MyCoreconLiteEmulator" and placed it in "CSIDL_PERSONAL\My Device Emulators" directory, it will light up in Device Emulator Manager view as

- My Device Emulators

- Windows Embedded CE 6.0

- MyCoreconLiteEmulator

Now you can access this MyCoreconLiteEmulator node in DEM view similar to you access any of the emulator nodes present with Visual Studio installed on your m/c.

There are few points which need to be taken care with the corecon-lite decfg files

  1. Presence of VMID element:- DECFG files in corecon-lite nodes should have VMID element. This is needed because for DEM, device emulator VMID is the primary key using which DEM figures out the state of emulators. So whenever an emulator starts, it registers itself in a ROT and DEM uses this to know the state of emulator.
  2. Colliding VMID resolution:- If there are multiple decfg files with the same VMID (or VMID collides with Corecon emulator), then DEM will display only one emulator node for which the priority order is Datastore emulator, My Device Emulators, All Device Emulators and then Others node (Others node is basically running emulator registered in ROT which doesn't belong to any of above categories). For example, if there is a MyDevEmu.decfg file in "My Device Emulators" directory with VMID X and a AllDevEmu.decfg in "All Device Emulators" directory with the same VMID X, then in DEM view only MyDevEmu node will be shown but not AllDevEmu node. In a perticular directory, the order of selection is not deterministic.

On Win-XP the CSIDL mapping is (To know more about CSIDL mappings https://msdn2.microsoft.com/en-us/library/ms649274.aspx)

  • CSIDL_PERSONAL ~ c:\documents and settings\<user name>\My Documents.
  • CSIDL_COMMON_DOCUMENTS ~ C:\Documents and Settings\All Users\Documents

Can i use decfg file in an arbitrary location?

Yes, you can launch decfg file from any arbitrary location using the File->Open menu of Device Emulator Manager.

 Hope you will like this feature.

-Mohit

 This posting is provided "AS IS" with no warranties, and confers no rights.  
 

Appendix 1:- Schema for decfg files.

Following is the schema you can use for decfg files

<?xml version="1.0" encoding="utf-8"?>

<!-- Microsoft Device Emulator 1.0 Configuration Schema -->

<xs:schema targetNamespace="https://schemas.microsoft.com/DeviceEmulator/2006/01/DeCfg" elementFormDefault="qualified" xmlns="https://schemas.microsoft.com/DeviceEmulator/2006/01/DeCfg" xmlns:mstns="https://schemas.microsoft.com/DeviceEmulator/2006/01/DeCfg" xmlns:xs="https://www.w3.org/2001/XMLSchema">

<xs:element name="DeviceEmulator">

<xs:complexType>

<xs:sequence>

<xs:element name="PlatformName" type="xs:string">

<xs:annotation>

<xs:documentation>

The inner text specifies the name of the platform node to display this configuration in.

</xs:documentation>

</xs:annotation>

</xs:element>

<xs:element name="Emulator">

<xs:annotation>

<xs:documentation>

Defines the configuration of the emulator itself.

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:sequence>

<xs:element name="AllowPassiveKitl" type="xs:boolean" default="false">

<xs:annotation>

<xs:documentation>

Allow KITL to connect in passive mode

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

<xs:attribute name="Reconfigurable" type="xs:boolean" fixed="false" use="optional" />

</xs:complexType>

</xs:element>

<xs:element name="Language" type="xs:nonNegativeInteger" minOccurs="0" maxOccurs="1">

<xs:annotation>

<xs:documentation>

Specifies the UI language, as a decimal LangID.

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

<xs:attribute name="Reconfigurable" type="xs:boolean" fixed="false" use="optional" />

</xs:complexType>

</xs:element>

<xs:element name="AlwaysOnTop" type="xs:boolean" minOccurs="0" maxOccurs="1" default="false">

<xs:annotation>

<xs:documentation>

Keeps the emulator window always on top.

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:attribute name="Enabled" type="xs:boolean" default="false" use="optional" />

<xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

</xs:complexType>

</xs:element>

<xs:element name="ConsoleWindow" type="xs:boolean" minOccurs="0" maxOccurs="1" default="false">

<xs:annotation>

<xs:documentation>

Creates and displays a console window to show output from Serial Port 1.

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

<xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

</xs:complexType>

</xs:element>

<xs:element name="HostKey" type="xs:string" minOccurs="0" maxOccurs="1">

<xs:annotation>

<xs:documentation>

Specifies host key, where the inner text can be "None", "Left-Alt", or "Right-Alt".

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

<xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

</xs:complexType>

</xs:element>

<xs:element name="Rotation" type="xs:nonNegativeInteger" minOccurs="0" maxOccurs="1" default="0">

<xs:annotation>

<xs:documentation>

Rotates the display by degrees, where the inner text angle can be 0, 90, 180, or 270.

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

<xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

</xs:complexType>

</xs:element>

<xs:element name="VMID" type="xs:string" minOccurs="0" maxOccurs="1">

<xs:annotation>

<xs:documentation>

Virtual Machine Identifier GUID.

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

<xs:attribute name="Reconfigurable" type="xs:boolean" fixed="false" use="optional" />

</xs:complexType>

</xs:element>

<xs:element name="VMName" type="xs:string" minOccurs="0" maxOccurs="1">

<xs:annotation>

<xs:documentation>

Specifies the window title.

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

<xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

</xs:complexType>

</xs:element>

<xs:element name="SaveState" minOccurs="0" maxOccurs="1">

<xs:annotation>

<xs:documentation>

Savestate configuration. The optional inner text specifies the savestate filename.

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:simpleContent>

<xs:extension base="xs:string">

<xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

<xs:attribute name="Reconfigurable" type="xs:boolean" fixed="false" use="optional" />

</xs:extension>

</xs:simpleContent>

</xs:complexType>

</xs:element>

<xs:element name="NoSecurityPrompt" minOccurs="0" maxOccurs="1" type="xs:boolean" default="false">

<xs:annotation>

<xs:documentation>

Do not prompt for unsafe peripherals.

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

<xs:attribute name="Reconfigurable" type="xs:boolean" fixed="false" use="optional" />

</xs:complexType>

</xs:element>

<xs:element name="DefaultSave" type="xs:boolean" default="false" minOccurs="0" maxOccurs="1">

<xs:annotation>

<xs:documentation>

Use VMID to find save-state location. SaveState and Default elements are mutually exclusive

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

<xs:attribute name="Reconfigurable" type="xs:boolean" fixed="false" use="optional" />

</xs:complexType>

</xs:element>

<xs:element name="Zoom" type="xs:boolean" minOccurs="0" maxOccurs="1" default="false">

<xs:annotation>

<xs:documentation>

Zooms the display to 2x normal size.

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

<xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

</xs:complexType>

</xs:element>

<xs:element name="Video" minOccurs="0" maxOccurs="1">

<xs:annotation>

<xs:documentation>

Video configuration, unless overridden by the presence of a skin. Skin and Video are mutually exclusive.

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:sequence>

</xs:sequence>

<xs:attribute name="Height" type="xs:nonNegativeInteger" />

<xs:attribute name="Width" type="xs:nonNegativeInteger" />

<xs:attribute name="BitsPerPixel" type="xs:nonNegativeInteger" />

<xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

<xs:attribute name="Reconfigurable" type="xs:boolean" fixed="false" use="optional" />

</xs:complexType>

</xs:element>

<xs:element name="Skin" minOccurs="0" maxOccurs="1">

<xs:annotation>

<xs:documentation>

Skin configuration. The inner text is the skin XML filename.

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:simpleContent>

<xs:extension base="xs:string">

<xs:attribute name="ToolTips">

<xs:annotation>

<xs:documentation>

Enables or disables tooltips.

</xs:documentation>

</xs:annotation>

<xs:simpleType>

<xs:restriction base="xs:string">

<xs:enumeration value="on" />

<xs:enumeration value="off" />

<xs:enumeration value="delay" />

</xs:restriction>

</xs:simpleType>

</xs:attribute>

<xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

<xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

</xs:extension>

</xs:simpleContent>

</xs:complexType>

</xs:element>

<xs:element name="FuncKey" type="xs:nonNegativeInteger" minOccurs="0" maxOccurs="1" default="0">

<xs:annotation>

<xs:documentation>

Specifies the func-key to be used by Emulator.

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

<xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

</xs:complexType>

</xs:element>

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="Board">

<xs:annotation>

<xs:documentation>

Defines the configuration of the emulated motherboard.

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:sequence>

<xs:element name="OSImage">

<xs:annotation>

<xs:documentation>

Specifies the file name of the OS image file (.bin or .nb0) as the inner text.

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:simpleContent>

<xs:extension base="xs:string">

<xs:attribute name="Address" type="xs:nonNegativeInteger" minOccurs="0" maxOccurs="1">

<xs:annotation>

<xs:documentation>

Specifies the base address to load the OS image file at, if it is .nb0 format.

</xs:documentation>

</xs:annotation>

</xs:attribute>

<xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

<xs:attribute name="Reconfigurable" type="xs:boolean" fixed="false" use="optional" />

</xs:extension>

</xs:simpleContent>

</xs:complexType>

</xs:element>

<xs:element name="Flash">

<xs:annotation>

<xs:documentation>

NAND Flash settings. The optional inner text specifies the flash-memory storage filename.

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:simpleContent>

<xs:extension base="xs:string">

<xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

<xs:attribute name="Reconfigurable" type="xs:boolean" fixed="false" use="optional" />

</xs:extension>

</xs:simpleContent>

</xs:complexType>

</xs:element>

<xs:element name="MemSize" type="xs:nonNegativeInteger" minOccurs="0" maxOccurs="1" default="64">

<xs:annotation>

<xs:documentation>

Sets emulated RAM size, where size is in megabytes.

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

<xs:attribute name="Reconfigurable" type="xs:boolean" fixed="false" use="optional" />

</xs:complexType>

</xs:element>

<xs:element name="CpuCore" type="xs:string" default="armv4">

<xs:annotation>

<xs:documentation>

Specifies the cpu core type. An unknown value means armv4

</xs:documentation>

</xs:annotation>

<xs:simpleType>

<xs:restriction base="xs:string">

<xs:enumeration value="armv4" />

<xs:enumeration value="armv5" />

<xs:enumeration value="armv6" />

<xs:enumeration value="armv7" />

</xs:restriction>

</xs:simpleType>

</xs:element>

<xs:element name="CpuOptions" type="xs:string">

<xs:annotation>

<xs:documentation>

Specifies what CPU features to enable.

</xs:documentation>

</xs:annotation>

<xs:simpleType>

<xs:restriction>

<xs:enumeration value="e"/>

<xs:enumeration value="E" />

<xs:enumeration value="M" />

<xs:enumeration value="m" />

</xs:restriction>

</xs:simpleType>

</xs:element>

<xs:element name="vfp" type="xs:boolean" default="false">

<xs:annotation>

<xs:documentation>

Specifies whether VFP is enabled or not

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

<xs:attribute name="Reconfigurable" type="xs:boolean" fixed="false" use="optional" />

</xs:complexType>

</xs:element>

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="Peripherals">

<xs:annotation>

<xs:documentation>

Defines the configuration of the emulated peripheral devices.

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:sequence>

<xs:element name="Battery" minOccurs="0" maxOccurs="1">

<xs:annotation>

<xs:documentation>

Battery/AC configuration.

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:sequence>

</xs:sequence>

<xs:attribute name="Charge" type="xs:nonNegativeInteger" default="100">

<xs:annotation>

<xs:documentation>

Emulated battery charge percentage.

</xs:documentation>

</xs:annotation>

</xs:attribute>

<xs:attribute name="IsOnACPower" type="xs:boolean" default="true">

<xs:annotation>

<xs:documentation>

Set to "true" to run on AC, or "false" to run on battery.

</xs:documentation>

</xs:annotation>

</xs:attribute>

<xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

<xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

</xs:complexType>

</xs:element>

<xs:element name="SerialPort" minOccurs="0" maxOccurs="3">

<xs:annotation>

<xs:documentation>

Maps a guest serial port to a Windows serial port.

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:simpleContent>

<xs:extension base="xs:string">

<xs:attribute name="UARTNumber" type="xs:nonNegativeInteger">

<xs:annotation>

<xs:documentation>

Guest serial port number (0-2).

</xs:documentation>

</xs:annotation>

</xs:attribute>

<xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

<xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

</xs:extension>

</xs:simpleContent>

</xs:complexType>

</xs:element>

<xs:element name="SharedFolder" minOccurs="0" maxOccurs="1">

<xs:annotation>

<xs:documentation>

Mounts the directory specified in the inner text as a storage card. A empty string specifies disable folder-share.

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:simpleContent>

<xs:extension base="xs:string">

<xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

<xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

</xs:extension>

</xs:simpleContent>

</xs:complexType>

</xs:element>

<xs:element name="CS8900_Networking" minOccurs="0" maxOccurs="1">

<xs:annotation>

<xs:documentation>

Configures the emulated CS8900 network card. The optional inner text specifies the host MAC address to bind to.

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:simpleContent>

<xs:extension base="xs:string">

<xs:attribute name="EnableNetwork" type="xs:boolean" default="true">

<xs:annotation>

<xs:documentation>

Enables or disables the emulated CS8900 network card.

</xs:documentation>

</xs:annotation>

</xs:attribute>

<xs:attribute name="Enabled" use="optional" default="true" type="xs:boolean" />

<xs:attribute name="Reconfigurable" type="xs:boolean" fixed="false" use="optional" />

</xs:extension>

</xs:simpleContent>

</xs:complexType>

</xs:element>

<xs:element name="NE2000_Networking" minOccurs="0" maxOccurs="1">

<xs:annotation>

<xs:documentation>

Configures the emulated NE2000 PCMCIA network card. The optional inner text specifies the host MAC address to bind to.

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:simpleContent>

<xs:extension base="xs:string">

<xs:attribute name="EnableNetwork" type="xs:boolean" default="true">

<xs:annotation>

<xs:documentation>

Enables or disables the emulated NE2000 network card.

</xs:documentation>

</xs:annotation>

</xs:attribute>

<xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

<xs:attribute name="Reconfigurable" type="xs:boolean " fixed="true" use="optional" />

</xs:extension>

</xs:simpleContent>

</xs:complexType>

</xs:element>

<xs:element name="HostOnlyNetworking" type="xs:boolean" minOccurs="0" maxOccurs="1" default="false">

<xs:annotation>

<xs:documentation>

Sets host-only routing for network packets.

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

<xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

</xs:complexType>

</xs:element>

<xs:element name="Speakerphone" minOccurs="0" maxOccurs="1">

<xs:annotation>

<xs:documentation>

Configures the speakerphone emulation.

</xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:sequence>

</xs:sequence>

<xs:attribute name="Speakerphone" type="xs:boolean" default="false" />

<xs:attribute name="CarKit" type="xs:boolean" default="false" />

<xs:attribute name="Headset" type="xs:boolean" default="false" />

<xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional"/>

<xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

</xs:complexType>

</xs:element>

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:schema>

Comments