apps for bluetooth, hid, and usb devices
DESCRIPTION
Apps for Bluetooth, HID, and USB devices. Ellick Sung Program Manager 3 -026. It’s easy to build apps for a rich ecosystem of USB , HID, and Bluetooth devices. Agenda. Device protocol access in Windows Key concepts Bluetooth RFCOMM Resources. New Device Protocol APIs in Windows 8.1. - PowerPoint PPT PresentationTRANSCRIPT
Apps for Bluetooth, HID, and USB devices
Ellick SungProgram Manager3-026
It’s easy to build apps for a rich ecosystem of USB, HID, and Bluetooth devices
Device protocol access in WindowsKey conceptsBluetooth RFCOMMResources
Agenda
New Device Protocol APIs in Windows 8.1New Windows Runtime APIs:
• Bluetooth (RFCOMM)
• Bluetooth Smart
• HID• USB• Wi-Fi Direct
Innovative Devices
Ecosystem of Apps
Independent
Developers
Device Protocol APIs
Demo: Sphero
Key concepts
User consent and confidenceAccess restricted to capabilities declared in the app manifest
High-level capability exposed to the user, who must consent to allow the app to access the device
User may revoke access at any time
Ability to restrict down to the specific capability and device
Ensuring app permissions are controlled by the user
Discover and use the deviceBuilds upon existing patterns for Windows.Devices
Familiar ways to interact with each transportBluetooth – RFCOMM via Sockets (includes SPP devices)Bluetooth Smart – GATT ClientHID – Example: vendor-specific usageUSB – WinUSB based
Use standard or proprietary protocols Some inbox classes reserved
Bluetooth RFCOMM
Windows.Devices.Bluetooth.RfcommDevice discovery and pairing using familiar Bluetooth user experience
Windows Runtime API to connect, host, and communicate with Bluetooth RFCOMM device services
Devices using Serial Port Profile (SPP) are supported
Service Discovery Protocol (SDP) client and server
Rfcomm API
RfcommDeviceService
Client - Represents a remote device service
RfcommServiceProvider
Server -Represents a local service
Demo: Sphero client app sample
Declaring app capabilitiesDeclare the device capabilityDevice capability name: “bluetooth.rfcomm”Declare the RFCOMM Service“name:<ServiceName>”“serviceId:<ServiceUuid>”Optional: Restrict your app to a specific device“any”“vidpid: <vendor Id> <product Id> <ID source: bluetooth | usb>”
Declare the RFCOMM capabilities in the app manifest
Declaring app capabilities (basic)<!–- We'll use the Serial Port Profile service on any device. --><m2:DeviceCapability Name="bluetooth.rfcomm"> <m2:Device Id="any"> <m2:Function Type="name:serialPort" /> </m2:Device></m2:DeviceCapability>
Declaring app capabilities (advanced)<!–- We'll use different services on two specific devices. --><m2:DeviceCapability Name="bluetooth.rfcomm"> <m2:Device Id="any"> <m2:Function Type="serviceId:AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE" /> </m2:Device> <m2:Device Id="vidpid:2000 B000 bluetooth"> <m2:Function Type="name:serialPort" /> </m2:Device></m2:DeviceCapability>
Client: Service discovery and instantiation
Use RfcommDeviceService’s helpers to retrieve an RFCOMM-specific selector.RfcommDeviceService.GetDeviceSelector
Use an enumerated DeviceInformation object to instantiate an RfcommDeviceService.RfcommDeviceService.FromIdAsync
Discover RfcommDeviceServices with the Windows.Devices.Enumeration API
Client: Communicating with the Device
Use StreamSocket.ConnectAsync to connect to the remote device.Use the ConnectionHostName and ConnectionServiceName properties on the RfcommDeviceService to connect.
I/O over the connected StreamSocket is available via its InputStream and OutputStream properties.You can use the DataReader and DataWriter classes to read primitive types (such as UInt32s or strings).
Use a StreamSocket to communicate with the remote device
You must dispose of your Rfcomm objects when your application is suspended.
Sample code walk through
TakeawaysIt’s easy to build Windows Store apps for USB, HID, Bluetooth, and Bluetooth Smart devices
Write apps for anything from your own device projects to retail peripherals
Make devices accessible to the entire Windows Store app ecosystem
ResourcesRelated Sessions[2-023] Building apps that connect with devices[3-924a] Apps for USB devices[3-924b] Apps for HID devices[3-9028] Apps for Bluetooth Smart devices
Samples and DocumentationWindows.Devices.Bluetooth.Rfcomm API referenceBluetooth RFCOMM chat sampleWindows Store app samples (search for Sphero)
© 2013 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.
Bluetooth and Bluetooth SmartGlobal standardLow costRobustSecureProfile interoperabilityLow powerEasy to use
Wireless connectivity for devices
Device protocol access made easy Windows Runtime APIs for direct access to devices:
No drivers needed, just an appLess complexity, increased reliabilitySupported on all Windows platforms
Bluetooth (RFCOMM)Bluetooth SmartHIDUSBWi-Fi Direct
Hardware developersCreate an app for your device
Enable an ecosystem of appsUse a standard protocol if available…or publish your proprietary protocol
Software developersCreate apps for retail devicesUse the standard protocol if implemented…or download the proprietary protocol if available
Market your apps easily via the Windows Store
Write apps for your own device projects
Windows.Devices.Bluetooth.GenericAttributeProfile
Device discovery and pairing using familiar Bluetooth user experience
Windows Runtime API to collect and administer Bluetooth Smart device dataNo driver needed
GATT Client support
Device distribution starts after sessions conclude today (approximately 6:00pm) in the Big Room, Hall D. If you choose not to pick up your devices tonight, distribution will continue for the duration of the conference at Registration in the North Lobby.
Get your goodies
Acer Iconia W3, Surface Pro, and Surface Type Cover
Evaluate this session
Scan this QR code to evaluate this session and be automatically entered in a drawing to win a prize!
© 2013 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.