slide1 l.
Skip this Video
Loading SlideShow in 5 Seconds..
Windows CE SDK PowerPoint Presentation
Download Presentation
Windows CE SDK

Loading in 2 Seconds...

play fullscreen
1 / 31

Windows CE SDK - PowerPoint PPT Presentation

  • Uploaded on

Windows CE .net SDK Miro Juric Software Design Engineer/Test Microsoft Introduction Overview of UPnP support in Windows CE (device side) Overview of UPNP support in Windows CE (control point side) IPv6 support Windows CE support for UPnP Internet Gateway Device – Demo Q/A

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'Windows CE SDK' - liam

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

Windows CE .net SDK

Miro Juric

Software Design Engineer/Test


  • Overview of UPnP support in Windows CE (device side)
  • Overview of UPNP support in Windows CE (control point side)
  • IPv6 support
  • Windows CE support for UPnP Internet Gateway Device – Demo
  • Q/A
upnp support on ce
UPnP support on CE
  • Device hosting APIs
    • Allow implementation of UPnP devices
    • COM (primary SDK API)
    • C ( available to OEMs)
  • Control point APIs
    • Discovery and control of remote devices
    • COM
  • Bridging
    • Expose non-UPnP devices as UPnP
    • No special support required
upnp architecture on ce



Device hosting

COM layer

Control Point

COM layer





Device API

Control Point API




Device IOCTL






ISAPI extn




UPnP architecture on CE
upnp device host
UPnP Device Host
  • Infrastructure that simplifies building UPnP devices and bridges on Windows®
  • Allows hosting of multiple devices
what does the device host infrastructure do
What does the device host infrastructure do?
  • Announces presence of registered devices
    • Renews the advertisements automatically
    • Responds to search requests as well
  • Responds to requests for device/service descriptions
  • Invokes actions requested by control points on services
  • Handles eventing
    • Accepts subscription requests
    • Maintains the list of subscribers per service
    • Sends events to all the subscribers
so what does the hosted device implement
So what does the hosted device implement?
  • IUPnPDeviceControl
    • Is the device manager for contained services and devices
  • A service object per hosted service. For each service object, implement the following:
    • IDispatch
      • Service exposes a dispatch interface for its exposed actions and state variables
    • IUPnPEventSource [Optional]
      • Service implements this interface to send state variable changes to the device host infrastructure
  • Device host infrastructure takes care of everything else!
upnp device hosting com
UPnP device hosting (COM)
  • Need a XML device description template
  • Need a SCPD XML file for each service
  • Implement a COM object exposing IUPnPDeviceControl
  • Implement a Dispatch interface for each service
  • Call IUPnPRegisterRunningDevice to publish the device
upnp device hosting com9
UPnP Device Hosting (COM)














Service 2

Service 1







upnp device hosting com10
UPnP Device Hosting (COM)
  • IUPnPDeviceControl is the top level interface to your device
    • Initialize(

/*[in]*/ BSTR bstrXMLDesc,

/*[in]*/ BSTR bstrDeviceIdentifier, // device to Init (RegisterDevice)

/*[in]*/ BSTR bstrInitString); //identifies the init string specific to device

    • GetServiceObject(

/*[in]*/ BSTR bstrUDN, // Device UDN

/*[in]*/ BSTR bstrServiceId, // Service ID for which to obtain pointer

/*[out, retval]*/ IDispatch ** ppdispService); //Idispatch pointer to service object

  • Each service object exposes IDispatch and IUPnPEventSource
    • IDispatch is invoked for every control request
    • IUPnPEventSourceis used for outbound event notifications when a state variable changes
  • To support eventing, a service object implements IUPnPEventSource
  • Interface has two methods:
    • Advise
      • Device host calls this method and gives the service object a pointer to an IUPnPEventSink interface
      • This gives the service object a way to pass back state changes to device host
    • Unadvise
      • Device host calls this method to tear down eventing
  • To send an event
    • Service calls IUPnPEventSink::OnStateChanged with a list of dispids for state variables that have changed
    • Device host queries the dispids, gets the changed values and sends an event to the subscribers
device registration
Device Registration
  • Device Host generates the appropriate URLs in the device description template
  • Device Host replaces UDNs in the device description template with globally unique identifiers
    • Allows the device to be registered on multiple machines using the same template
    • Allows the device to be registered on the same machine multiple times using the same template
  • Identifier passed back that allows a device to be unregistered
upnp device hosting com13
UPnP Device Hosting (COM)
  • Use UPnPRegistrar object to publish your device
    • RegisterDevice (

/* [in] */ BSTR bstrXMLDesc,

/* [in] */ BSTR bstrProgIDDeviceControlClass,

/* [retval][out] */ BSTR *pbstrDeviceIdentifier);

Registers the device to run in context of device host – persists across sys boots

    • RegisterRunningDevice (

/* [in] */ BSTR bstrXMLDesc,

/* [in] */ IUnknown *punkDeviceControl, // IUPnPDeviceControl

/* [retval][out] */ BSTR *pbstrDeviceIdentifier);

Returns Device identifier to be used for Unregister – does not persist across sys boots

    • UnregisterDevice(

/* [in] */ BSTR bstrDeviceIdentifier,

/* [in] */ BOOL fPermanent);

    • GetUniqueDeviceName

Retrieves the UDN of a device

upnp device hosting c
UPnP Device Hosting (C)
  • Using low level C-style API (OEM only)
  • In this approach UPnP stack translates UPnP messages for the UPnP device to calls into a C-style callback function provided by device implementation. UPnP stack doesn’t perform any encoding/decoding of arguments or state variables so device implementation has to deal with values in the format mandated by UPnP.
  • Not as full featured, but smaller foot print for OEMs making very small devices
upnp device hosting c15
UPnP Device Hosting (C)
  • UPnPAddDevice to create a named device based on your description.
  • Supply a callback function
  • UPnPPublishDevice to announce the device on the network
  • Callback function invoked on receiving control requests
  • UPnPSetControlResponse to send a response back
  • UPnPSubmitEvent to send event notifications to subscribers
control point api
Control Point API
  • COM interfaces for building UPnP control points
    • IUPnPDeviceFinder
    • IUPnPDevices
    • IUPnPDevice
    • IUPnPServices
    • IUPnPService
object model

Devices Collection


Services Collection

Object Model

Device Finder

object model18

Services Collection


XML (SOAP) to device

Events (GENA) from device

Object Model
upnp control point
UPnP Control Point
  • Creating Device Finder
    • IUPnPDeviceFinder * pDevFind = NULL;
    • CoCreateInstance(CLSID_UPnPDeviceFinder,


(void **) &pDevFind);

  • Search for Device
    • IUPnPDevices * pFoundDevices = NULL;
    • bstrTypeURI = SysAllocString


pDevFind->FindByType(bstrTypeURI, 0, &pFoundDevices);

    • ::FindByType method searches by device or service type
upnp control point20
UPnP Control Point
  • Enumerate Device
    • IUPnPDevices *pFoundDevices
    • IUnknwn *pUnk = NULL;
    • pFoundDevices->get_NewEnum(&pUnk)
    • Device Objects in the collection are contained within VARIANT structures – these structures contain pointers to IDispatch interfaces on the device objects
    • // Obtain IUPnPDevice *pDevice interface
  • Get IUPnPServices – service collection
    • GetService(IUPnPDevice *pDevice)
    • IUPnPServices *pServices = NULL;
    • IUPnPService *pClockServics = NULL;
    • pDevice->get_Services(&pServices)
upnp control point21
UPnP Control Point
  • Get Service Object
  • We have IUPnPServices *pServices
    • IUPnPService *pClockService = NULL;
    • IUPnPService *pAlarmService = NULL;
    • bstrClockSvcId = SysAllocString


    • pServices->get_Item(bstrSvcId, &pClockService)
    • pServices->get_Item(bstrAlarmSvcID, &pAlarmService)
upnp control point22
UPnP Control Point
  • Invoke Actions – control
    • IUPnPService::InvokeAction – method
    • pClockService->InvokeAction

( bstrActionName,




        • VARIANT varInArgs;
  • QueryStateVariable
    • Discouraged by UPnP Forum
  • Windows CE supports UPnP over IPv4 and IPv6 networks
    • IPv6 support only
      • UPnP devices will use only IPv6 addresses
    • IPv4 + IPv6
      • UPnP devices will use IPv6 address with IPv6 capable hosts on the network and IPv4 address with devices supporting only IPv4
    • IPv4 only
      • UPnP devices use IPv4 only - Default
ipv6 scope
IPv6 Scope
  • Link Local  Addresses (begins with FE80:…..)
    • This means listening and broadcasting on FF02::C, the link-local scope multicast address for the link-local scope multicast address for SSDP – Default
  • Site Local  Addresses– (begins with FEC0:….)
  • Link local is used always. Site local is optional in addition to link local.
  • Uses scoping of IPv6 addresses to control the propagation of SSDP messages instead of Hop Limit (equivalent to the TTL limit in IPv4).
upnp samples
UPnP Samples
  • Samples in Windows CE .Net
    • Devices:
      • Internet Gateway Device
        • Implements required schema and interacts with an actual Gateway implementation.
        • Fully functional IGD – UPnP certified
    • Control Point:
      • Universal Control Point sample
platform builder 4 10
Platform Builder 4.10
  • Platform Builder is an integrated development environment (IDE) for building customized embedded platforms based on the Microsoft® Windows® CE .NET operating system (OS).
  • Platform Builder comes with all the development tools necessary for you to design, create, build, test, and debug a Windows CE–based platform. The IDE provides a single integrated workspace in which you can work on both platforms and projects
pb configurations
PB Configurations
  • Residential_gateway
  • PDA
  • Web Pad Enterprise

Building Windows CE based Residential Gateway Image with UPnP Internet Gateway Device

Miro JuricSoftware Design Engineer/Test

Windows CE

  • UPnP supported in Windows CE
  • Pocket PC – Windowc CE OS
  • Device hosting included in 4.0
  • Control point included in 4.0
  • Same API’s as XP!!
  • Generic Control Point sample
  • Working IGD for Gateways