Download presentation
Presentation is loading. Please wait.
Published byEverett Bryant Modified over 9 years ago
1
Plug And Play For Network Connected Devices Cameron Brodeur and Kristina Hotz Program Managers Windows Device Experience Group Microsoft Corporation
2
Session Outline Discusses generic resource discovery and how to turn a Network Connected Device (NCD) into a Plug and Play (PnP) device Windows Rally Overview Function Discovery (FD) Plug and Play Extensions for Network Connected Devices (PnP-X) DemoQuestions
3
Windows® Rally™ Program Simple Unified License Access to Technologies Technical Guidance
4
Windows® Rally™ Devices Reliable and simple to manage Effortless to configure and maintain More secure and provide rich digital experiences
5
Windows Rally Experiences Applications IP Network (IPv4, IPv6) Wireless Setup Ethernet/Wireless Quality of Service AV Devices Discovery Network Map Windows Rally Experiences Device Specific Drivers Management Interfaces Networked Devices LLTD: QoS ExtensionsLLTD: Topology MapWindows Connect Now Function Discovery UPnP Device Profile for Web Services Plug and Play Extensions Windows Rally Technologies
6
Function Discovery Generic resource detection Kristina Hotz Program Manager
7
Why Function Discovery? Many flavors of devices and resources USBWSDUPnP Different protocols Different discovery Different metadata acquisition Need abstraction layer for unification NetBIOSEtc.
8
Function Discovery (FD) New feature in Windows Vista for resource discovery Provides uniform API for resource discovery and metadata exchange Is extensible allowing discovery via virtually any protocol Can aggregate results from multiple protocols Find NetBIOS and WSD shares with single query Find all UPnP and WSD devices with same code
9
FD Architectural Overview Function Discovery API Client Query Manager WNet Provider WNet APIs SSDP Provider SSDP WSD Provider WSD 3 rd Party Provider Native APIs Registry PnP Provider Registry Provider Setup DI API Category Manager Registry Legend: Client Client Interface Providers Underlying APIs Internal Components
10
Discovery: PnP hDevInfoSet = ::SetupDiGetClassDevs ( hDevInfoSet = ::SetupDiGetClassDevs ( NULL, NULL, DIGCF_ALLCLASSES ); DIGCF_ALLCLASSES ); bSuccess = ::SetupDiEnumDeviceInfo ( bSuccess = ::SetupDiEnumDeviceInfo ( hDevInfoSet, hDevInfoSet, dwIndex++, dwIndex++, &sddInfoElement ); &sddInfoElement ); if (bSuccess) { pRootDevNode = new DevNode; pRootDevNode = new DevNode; pRootDevNode->guidClass = sddInfoElement.ClassGuid; pRootDevNode->guidClass = sddInfoElement.ClassGuid; if (::SetupDiGetDeviceInstanceId( if (::SetupDiGetDeviceInstanceId( hDevInfoSet, hDevInfoSet, &sddInfoElement, &sddInfoElement, szDevId, szDevId, 2047, 2047, &dwSizeNeeded )) &dwSizeNeeded )) { pRootDevNode->pszName = new pRootDevNode->pszName = new WCHAR[dwSizeNeeded]; WCHAR[dwSizeNeeded]; wcsncpy( wcsncpy( pRootDevNode->pszName, pRootDevNode->pszName, szDevId, szDevId, dwSizeNeeded ); dwSizeNeeded ); } pCurrDevNode = pRootDevNode; pCurrDevNode->pNext = NULL; while (::SetupDiEnumDeviceInfo ( hDevInfoSet, hDevInfoSet, dwIndex++, dwIndex++, &sddInfoElement )) &sddInfoElement )) { pCurrDevNode->pNext = new DevNode; pCurrDevNode->pNext = new DevNode; pCurrDevNode = pCurrDevNode->pNext; pCurrDevNode = pCurrDevNode->pNext; pCurrDevNode->guidClass = sddInfoElement.ClassGuid; pCurrDevNode->guidClass = sddInfoElement.ClassGuid; if (::SetupDiGetDeviceInstanceId( if (::SetupDiGetDeviceInstanceId( hDevInfoSet, hDevInfoSet, &sddInfoElement, &sddInfoElement, szDevId, szDevId, 2047, 2047, &dwSizeNeeded )) &dwSizeNeeded )) { pCurrDevNode->pszName = new pCurrDevNode->pszName = new WCHAR[dwSizeNeeded]; WCHAR[dwSizeNeeded]; wcsncpy( wcsncpy( pCurrDevNode->pszName, pCurrDevNode->pszName, szDevId, szDevId, dwSizeNeeded ); dwSizeNeeded ); } pCurrDevNode->pNext = NULL; pCurrDevNode->pNext = NULL; } *ppDevNodes = pRootDevNode; *ppDevNodes = pRootDevNode;}
11
Discovery: Registry lResult = RegOpenKeyEx( HKEY_LOCAL_MACHINE, HKEY_LOCAL_MACHINE, pwszSubKey, pwszSubKey, 0, 0, KEY_READ, KEY_READ, &hKey); &hKey); if( ERROR_SUCCESS == lResult ) if( ERROR_SUCCESS == lResult ) lResult = RegQueryInfoKey( lResult = RegQueryInfoKey( hKey, NULL, NULL, hKey, NULL, NULL, NULL, &dwSubKeys, NULL, NULL, &dwSubKeys, NULL, NULL, &dwValues, NULL, NULL, &dwValues, NULL, NULL, NULL, NULL); NULL, NULL, NULL); for( DWORD i = 0; ( i < dwValues ) && ( lResult == ERROR_SUCCESS ); i++ ) for( DWORD i = 0; ( i < dwValues ) && ( lResult == ERROR_SUCCESS ); i++ ) { WCHAR achValueName[MAX_PATH]; WCHAR achValueName[MAX_PATH]; DWORD cchValueName = ARRAY_SIZE( achValueName ); DWORD cchValueName = ARRAY_SIZE( achValueName ); DWORD dwType; DWORD dwType; BYTE* pBuffer = new BYTE[MAX_PATH]; BYTE* pBuffer = new BYTE[MAX_PATH]; DWORD dwBufSize = MAX_PATH; DWORD dwBufSize = MAX_PATH; lResult = RegEnumValue( lResult = RegEnumValue( hKey, i, achValueName, hKey, i, achValueName, &cchValueName, NULL, &cchValueName, NULL, NULL, NULL, NULL ); NULL, NULL, NULL ); if( ERROR_SUCCESS == lResult ) if( ERROR_SUCCESS == lResult ) { lResult = RegQueryValueEx( lResult = RegQueryValueEx( hKey, achValueName, NULL, hKey, achValueName, NULL, &dwType, pBuffer, &dwBufSize ); &dwType, pBuffer, &dwBufSize ); } if ( pBuffer ) if ( pBuffer ) delete pBuffer; delete pBuffer; } for( DWORD i = 0; ( i < dwSubKeys ) && ( lResult == ERROR_SUCCESS ); i++ ) for( DWORD i = 0; ( i < dwSubKeys ) && ( lResult == ERROR_SUCCESS ); i++ ) { WCHAR pwszNewSubKey[256]; WCHAR pwszNewSubKey[256]; dwSize = MAX_PATH; dwSize = MAX_PATH; lResult = RegEnumKeyEx( lResult = RegEnumKeyEx( hKey, i, szName, hKey, i, szName, &dwSize, NULL, NULL, &dwSize, NULL, NULL, NULL, &ftWrite); NULL, &ftWrite); if( SUCCEEDED( StringCchPrintf( if( SUCCEEDED( StringCchPrintf( pwszNewSubKey, 256, L"%s\\%s", pwszNewSubKey, 256, L"%s\\%s", pwszSubKey, szName))) pwszSubKey, szName))) { Result = EnumerateSubKeys( pwszNewSubKey ); Result = EnumerateSubKeys( pwszNewSubKey ); } } if( hKey ) if( hKey ) RegCloseKey( hKey ); RegCloseKey( hKey ); return ERROR_SUCCESS; return ERROR_SUCCESS;
12
Discovery: FD PnP hr = spDiscovery->CreateInstanceCollectionQuery( FCTN_CATEGORY_PNP, FCTN_CATEGORY_PNP, NULL, NULL, TRUE, TRUE, spNotify, spNotify, &spFunQuery ); &spFunQuery ); if ( SUCCEEDED( hr )) hr = spFunQuery->Execute( &spFunInsts ); hr = spFunQuery->Execute( &spFunInsts );
13
Discovery: FD Registry hr = spDiscovery->CreateInstanceCollectionQuery( FCTN_CATEGORY_REGISTRY, FCTN_CATEGORY_REGISTRY, NULL, NULL, TRUE, TRUE, spNotify, spNotify, &spFunQuery ); &spFunQuery ); if ( SUCCEEDED( hr )) hr = spFunQuery->Execute( &spFunInsts ); hr = spFunQuery->Execute( &spFunInsts );
14
Discovery: FD WSD hr = spDiscovery->CreateInstanceCollectionQuery( FCTN_CATEGORY_WSDISCOVERY, FCTN_CATEGORY_WSDISCOVERY, NULL, NULL, TRUE, TRUE, spNotify, spNotify, &spFunQuery ); &spFunQuery ); if ( SUCCEEDED( hr )) hr = spFunQuery->Execute( &spFunInsts ); hr = spFunQuery->Execute( &spFunInsts );
15
FD Feature Overview Discovery Query by protocol category instead of with protocol code Refine query using properties or constraints (i.e., PnP Interface IDs) Define aggregate categories to Target more than one provider I.e., NetBIOS and WSD Always apply constraints Category will only return network printers
16
FD Feature Overview Notifications Clients receive notifications from category Send on resource add/remove Activation Instantiate and initialize software objects associated with resource Application provides the ClassID and interface desired FD binds object to resource
17
The Function Instance (FI) Single unit of discovery Represents the discovered resource Created by the provider in response to a query Local resources returned as collection of Function Instances Network resources returned as discovered via notifications
18
The Function Instance (FI) Store resource information as properties Store contains Metadata Configuration data State data Exposed through IPropertyStore interface Allow read and write (when supported) of resource information
19
PnP-X Plug and Play for networked devices Cameron Brodeur Program Manager
20
Device Connectivity Options Windows provides many different options for device connectivity Wired buses USB 1.x and 2.0 IEEE 1394 Wireless personal area network Bluetooth Ultra-Wideband (UWB) IP connected Wi-FiEthernet
21
IP devices limited in adoption Custom solutions for integrating with Windows A non-PnP device Historically Dual approach The IP “bus” is handled differently from other buses This presents several problems Disparate programming models No single end-user experience The device experience depends on the connector selected Well understood experience when plugging into this port Fuels device adoption Lowers support costs A PnP device Undefined experience when plugging into this port
22
The Future Single model Unification of IP and directly connected devices Users should not have to care about the bus Directly Connected IP Network
23
Benefits NCDs are simple to discover and use Installed and managed just like local, bus-attached devices Lower support costs Broader device adoption NCDs can be enumerated and accessed using standard Windows application programming interfaces (APIs) Allows use of FD API and legacy APIs Improved end-user experience
24
Benefits NCDs benefit from existing Windows assets for device management Windows PnP and device management infrastructure Windows Update
25
Discovery Before a device can be installed, it must be discovered Network protocols replace the bus-specific electrical signals used for physically connected devices Metadata exchange Enough information about the device must be retrieved for installation purposes Hardware ID Class ID Friendly Name Etc.
26
Association With physical connections, the cable itself establishes the association For NCDs, the following questions apply With which PC is the device associated? Can the device be associated with more than one PC?
27
Enabling A Single Model Through PnP The framework for enabling a single connectivity model already exists today: It’s Windows PnP (Plug and Play) An IP bus enumerator (IPBusEnum) enumerates NCDs A PDO is created for each enumerated device PnP handles the installation of the device like any other device The enabling components are collectively called PnP-X: PnP extensions for NCDs PnP PCIUSB1394 PCMCIA IPBusEnum Class Drivers Physical DiscoveryNetwork Discovery
28
User opens Network Explorer Multicast sent by discovery providers List of device FIs returned to Network Explorer Network Explorer displays discovered devices Devices respond to multicast request FD creates a Function Instance (FI) for each device PnP-X devices presented as “Installable” User selects device for installation Network Explorer adds the FI to the Association Database, which is maintained as a FD category FD notifies IPBusEnum service that a new device has been added to Association Database IPBusEnum gathers data from FI and device Creates PnP device node (DevNode) PnP begins device install Finds matching INF file Loads device driver and software Function Discovery API PnP Network Discovery Providers IPBusEnum Association Database How PnP-X Works Network Explorer UI 3rd Party WSDSSDP Xbox FI Storage FI Printer FI WSDSSDP 3rd PartyWSDSSDP PnP DevNode Device Driver Legend: PnP-X Function Discovery Network Providers Driver
29
Applications now see the device as unavailable Queries to PnP reflect offline state Device starts-up Sends WSD Hello or SSPD Alive message FD creates FI for device; IPBusEnum notified IPBusEnum checks association database Matching device found in database PnP DevNode recreated Device driver loaded Applications now see the device as available Queries to PnP reflect online state Function Discovery API PnP Network Discovery Providers IPBusEnum How PnP-X Works Device goes offline Sends WSD Bye or SSDP Bye-Bye message Network Explorer UI 3rd Party WSDSSDP Storage FI WSDSSDP WSDSSDP PnP DevNode Device Driver IPBusEnum calls PnP Driver unloaded PnP DevNode removed Device shutdown Bye message sent Status: OFFLINE Device startup Alive message sent Status: ONLINE Association Database Storage Device Legend: PnP-X FunctionDiscovery NetworkProviders Driver 3rd Party
30
Inbox Protocol Support Inbox support is provided for the following discovery protocols in Windows Vista Web Services Discovery Protocol (WS-Discovery) Part of the Web Services on Devices suite of protocols Devices must support WS-Discovery as well as the Device Profile for Web Services to be installable by PnP-X Simple Services Discovery Protocol (SSDP) Used by UPnP for device discovery Devices must support SSDP as well as Device Description to be installable by PnP-X Support for additional protocols can be enabled through the installation of a FD provider Must conform to the requirements in the PnP-X and FD specifications See PnP-X and FD documentation for details
31
Device Requirements Devices must support one of the inbox protocols or provide a custom provider Devices must include additional XML data in the discovery metadata <HardwareId><CompatibleId><DeviceCategory> Allows PnP-X to recognize that the device is “installable” and create a PnP DevNode
32
Device-Side XML Example (UPnP) 1 1 0 0 http://192.168.0.1:1234 http://192.168.0.1:1234 MSFT_MediaPlayer_HWID MSFT_MediaPlayer_HWID MSFT_MediaPlayer_CPID MSFT_MediaPlayer_CPID MediaDevices MediaDevices urn:schemas-upnp- org:device:MediaRenderer:1 urn:schemas-upnp- org:device:MediaRenderer:1 Microsoft Advanced Media Player Microsoft Advanced Media Player Microsoft Microsoft...... </root>
33
DevNode Creation IPBusEnum creates a PnP DevNode for the device Information discovered about the device is stored in the DevNode property store, including IP Address Hardware IDs and Compatible IDs for the device Device UUID (GUID) PnP installs a driver using the “standard” process Search driver packages (INF files) looking for the best match based on hardware and compatible IDs Invoke the specified class installer and optional co-installer to carry out the installation process
34
Device Driver Details Manufacturer can supply a kernel-mode or user-mode driver for the device Driver can also be a class driver supplied by Microsoft For proprietary devices or devices that are tied to a single application, the install process can simply install the application or service
35
Communicating With Your Device Base-level functionality for an associated network connected device simply returns the IP address of the device Communication with network connected devices will go through existing network stacks.NET Framework WSDUPnPWinSock Protocol choice left up to the vendor
36
Industry Adoption PnP-X adoption is growing WSD-based printers Wi-Fi digital cameras Media Center Extender devices, including the Xbox 360 Network Attached Storage devices Adoption is accelerating The time to consider PnP-X for your networked devices is now
37
Maxtor Network Attached Storage
38
Call To Action Evaluate PnP-X and Function Discovery for your NCDs Review the PnP-X and Function Discovery documentation on MSDN For WSD and UPnP devices, update your device to provide the information specified by the PnP-X documentation For other devices, write a Function Discovery provider that conforms to requirements specified by the FD documentation
39
Additional Resources Web Resources Function Discovery Specs http://msdn.microsoft.com/library/default.asp?url=/library/en- us/fundisc/ncd/portal.asp http://msdn.microsoft.com/library/default.asp?url=/library/en- us/fundisc/ncd/portal.asp http://msdn.microsoft.com/library/default.asp?url=/library/en- us/fundisc/ncd/portal.asp PnP-X Specs See the Windows Rally SDK at http://www.microsoft.com/rally http://www.microsoft.com/rally Function Discovery SDK Documentation http://windowssdk.msdn.microsoft.com/library/default.asp?url= /library/en-us/fundisc/ncd/about_function_discovery.asp http://windowssdk.msdn.microsoft.com/library/default.asp?url= /library/en-us/fundisc/ncd/about_function_discovery.asp http://windowssdk.msdn.microsoft.com/library/default.asp?url= /library/en-us/fundisc/ncd/about_function_discovery.asp Whitepapers http://www.microsoft.com/rally http://www.microsoft.com/rally Related Sessions Web Services on devices in Windows Vista Web Services on devices: The protocol now and for the future Email address for more information rally @ microsoft.com
40
© 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.