CLI339 Building Bluetooth Applications On The Windows CE 5.0 And Windows Mobile Platforms Anil Dhawan Program Manager Windows Mobile.

Slides:



Advertisements
Similar presentations
Bluetooth.
Advertisements

4/6/2017 2:06 PM © 2005 Microsoft Corporation. All rights reserved.
MHK200 Module 1: Introduction to Windows CE. MHK200 Overivew Windows CE Design Goals Windows CE Architecture Supported Technologies, Libraries, and Tools.
BLUETOOTH TM :A new radio interface providing ubiquitous connectivity Jaap C.Haartsen Ericssion Radio System B.V IEEE.
EMB306 Building Windows CE Devices With DX Support John L. Marcantonio Program Manager Windows CE Multimedia Microsoft Corporation.
1 Introduction to Bluetooth v1.1 (Part I) Overview Radio Specification Baseband Specification LMP L2CAP.
EMB304 Building Trustworthy Windows CE Embedded Devices and Applications Ganapathy Raman Program Manager Windows CE Security Team Microsoft Corporation.
Sattam Al-Sahli – Emad Al-Hemyari –
Mohamed Mokdad Ecole d’Ingénieurs de Bienne
CPET 260 Bluetooth. What is Bluetooth? Not IEEE (Wi-Fi) or HomeRF Originally designed to replace wires Short-range, lower-power wireless technology.
1 Mini Course Programming Context-aware Mobile Phones Thomas Bodin IT University of Copenhagen.
Final Presentation Spring 2003 Project ID: D0822 Project Name: WinCE integrating BT media share application Supervisor: Evgeny Rivkin Performed by: Maya.
Amit Chopra APP209 Introducing “Orcas” Huh ? What’s “Orcas”?
EMB321 How To Write A Windows CE SDIO Client
Rob Hwacinski Sr. Program Manager Lead Microsoft Corporation WEM206 Ashwin Kulkarni Sr. Product Manager Microsoft Corporation.
EMB313 Increasing Developer Productivity With Windows CE 5.0 Matt Young Windows Mobile Joint Development Program (JDP) Microsoft.
Bluetooth Profile. Bluetooth profile A Bluetooth profile is a wireless interface specification for Bluetooth-based communication between devices. A Bluetooth.
© 2013 The McGraw-Hill Companies, Inc. All rights reserved Mike Meyers’ CompTIA A+ ® Guide to 802: Managing and Troubleshooting PCs Fourth Edition (Exam.
EMB425 Using Advanced Platform Builder Debugger Features James Stulz Program Manager Windows CE Core Tools Microsoft Corporation.
EMB313 Increasing Developer Productivity With Windows CE 5.0
BLUETOOTH. Introduction Bluetooth technology discussed here aims at so-called ad- hoc piconets, which are local area networks with a very limited coverage.
Bluetooth Architecture and Applications Chris Greco, Wesley Kunzler, Koy Rehme, Zhuo Ruan.
Respected Sir & dear friends. Presented by Mohd. Sufiyan MCA –Vth Sem Sec-A2 GIMT (Gr. Noida)
Bluetooth Profile. Bluetooth profile A Bluetooth profile is a wireless interface specification for Bluetooth-based communication between devices. A Bluetooth.
EMB318 Improve Product Quality Using Windows CE Error Reporting (Watson) James Stulz Program Manager Windows CE Core Tools Microsoft Corporation.
EMB315 Non-Volatile Object Store And Hive Based Registry Design For Windows CE Rick Austin Principle Engineer Intermec Corporation.
EMB426 Windows CE Memory Architecture Steve Maillet CEO/Chief Software Architect EmbeddedFusion.
CLI324 Tablet PC Platform Advanced Topics Software Design Engineer/Test Lead
Bluetooth: Introduction
BIZ208 Windows CE 5.0 Bringing to Market a Broad Range of Devices Dan Javnozon Product Manager MEDG Microsoft Corporation Business Track Presentation.
INTRODUCTION Bluetooth technology is code name for Personal Area Network (PAN) technology that makes it extremely easy to connect a mobile, computing device.
A+ Guide to Managing and Maintaining Your PC Fifth Edition Chapter 19 PCs on the Internet.
Bluetooth Background Ericsson, IBM, Intel, Nokia, and Toshiba
USB/1394 on the PC Mark Slezak Program Manager Windows Device experience group microsoft.com Microsoft Corporation.
EMB423 Creating A Trusted Environment For Windows CE 5.0 Nat Frampton President Real Time Development
DIUF, Seminar in Telecommunications, M. Hayoz The Bluetooth TM wireless technology A brief overview.
Bluetooth Techniques ECE 591. Overview  Universal short-range wireless capability  Uses 2.4-GHz band  Available globally for unlicensed users  Devices.
An Introduction to BLUETOOTH TECHNOLOGY
HandsFree Profile (HFP) 통신연구소 S/W Team 이상제.
EMB422 Advanced Embedded Visual C++ Application Development Control - View Nat Frampton President Real Time Development
BLUETOOTH Created By: Ajay Bahoriya. Agenda Introduction to Bluetooth Bluetooth Basics Mode of operation Technology Security Advantages Integrating BT.
EMB424 Implementing Fault Tolerant Systems in Windows CE 5.0 Nat Frampton President Real Time Development
Bluetooth Techniques Chapter 15. Overview of Bluetooth Initially developed by Swedish mobile phone maker in 1994 to let laptop computers make calls over.
발표자 : 현근수 Bluetooth. Overview wireless protocol short-range communications technology single digital wireless protocol connecting multiple devices mobile.
Team Topic Presentation Team 6 BLUETOOTH What is Bluetooth? Cable Replacement Automatic Connectivity Hidden Computing Few Examples: 1.Automatic Door.
New Managed Messaging, State, And Notification APIs In Windows Mobile 2005 Gaurav Khanna Developer Evangelist Microsoft India.
EMB427 Writing Real-Time Applications On Windows CE 5.0 Nat Frampton President Real Time Development Corporation
CLI205 Basic Considerations For Mobile PC Application Development Tablet and Mobile PC Technical Evangelist Microsoft Corporation.
CLI325 In Depth – Ink Data Management Mark Hopkins Programmer Writer Tablet and Mobile PC Group Microsoft Corporation.
Lectured By: Vivek Dimri Asst Professor CSE Deptt. SET.
Bluetooth In 1994, the L. M. Ericsson company became interested in connecting its mobile phones to other devices without cables. A SIG (Special Interest.
CLI210 Introduction To Managed Development For Devices With Visual Studio 2005 Scott D. Smith Program Manager Visual Studio for Devices Microsoft Corporation.
Advanced Memory Management Douglas Boling President Boling Consulting Inc.
Windows CE Services Douglas Boling President Boling Consulting Inc.
UCM305 Embedding Communications with UCMA SDK 1.0 Chris D. Mayo Technical Evangelist
Ryan McMahan Senior Software Engineer Shared Technology Intermec Bluetooth Integration Building Bridges to Bluetooth Enabled Peripherals.
Bluetooth Technology. History The name ‘Bluetooth’ was named after 10th century Viking king in Denmark Harald Bluetooth who united and controlled Denmark.
1 A cable replacement technology 1 Mb/s symbol rate Range 10+ meters Single chip radio at low power & low price point Bluetooth.
What is Bluetooth? A cable-replacement technology that can be used to connect almost any device to any other device Radio interface enabling electronic.
SSN College of Engineering
Introducing the Windows Mobile development
Bluetooth v2.0 EDR USB Dongle
A Wireless LAN technologies IEEE
Bluetooth, RFID, Data Link Layer Switching
Bluetooth Profiles.
Bluetooth, RFID, Data Link Layer Switching
1/14/2019 3:57 AM © 2004 Microsoft Corporation. All rights reserved.
Emilia Nisha D’souza [ ]
Presentation transcript:

CLI339 Building Bluetooth Applications On The Windows CE 5.0 And Windows Mobile Platforms Anil Dhawan Program Manager Windows Mobile

M anagement T ools C ommunications & M essaging Device Update Agent Software Update Services Live Communications Server Exchange Server Internet Security and Acceleration Server Speech Server Image Update L ocation S ervices M ultimedia MapPoint DirectX Windows Media Visual Studio 2005 D evelopment T ools Win32 MFC 8.0, ATL 8.0 N ative M anaged S erver S ide L ightweight R elational SQL Server 2005 Express EditionEDB D ata P rogramming M odel D evice B uilding T ools D evice B uilding T ools H ardware/ D rivers Windows XP DDK Windows Embedded Studio Platform Builder OEM/IHV Supplied BSP (ARM, SH4, MIPS) OEM Hardware and Standard Drivers Standard PC Hardware and Drivers SQL Server 2005SQL Server 2005 Mobile Edition ASP.NET Mobile ControlsASP.NET.NET Compact Framework.NET Framework Microsoft Operations Manager Systems Management Server

Agenda Technology Overview Bluetooth Application Concepts Windows CE Development Windows Mobile Development DemoQ&A

Technology Overview A short range wireless communication technology meter range Operates in 2.4 GHz band using frequency hopping Ad-Hoc network topology Supports voice and data through separate channels Support for device discovery Devices can be queried for capabilities Standardized services

Typical Usage Scenarios Audio Services Hands Free devices Wireless Stereo Headsets Wireless Data services Share Internet Connections Ad-Hoc Data Exchange Business card transfer File exchange Printing Cable Replacement Keyboard, Mouse, Printer

Agenda Technology Overview Bluetooth Application Concepts Windows CE Development Windows Mobile Development DemoQ&A

Bluetooth Devices Identified by unique address Advertise to others in discoverable mode Class of device field Devices maintain list of supported services Use Service Discovery for querying list on other devices

Bluetooth Services Describe data exchange protocols Identified by a unique GUID Standardized services called “profiles” for common use cases File Transfer (FTP) Dial-Up networking (DUN) Stereo Audio (A2DP)

General Tips Keep users informed Use OS UI for device discovery, pairing Application should handle latency Don’t block UI threads Handle errors gracefully Conserve the juice Limit time in discoverable mode Keep Bluetooth Off when not in use 5 step process for application development

The 5 Step Process Find devices in range Choose a device to connect with Establish a secure connection (pairing) Choose a service Transfer Data

Step 1: Find Devices In Range Target devices must be in discoverable mode Client device listens to broadcasts from discoverable devices

Step 2: Choose A Device To Connect With OS usually provides GUI to connect with another device Each device identified by a unique address

Step 3: Establish A Secure Connection Process called “pairing” Requires both end points to use the same pin key Usually part of connecting UI

Step 4: Choose A Service Each service identified by unique GUID Set of “standard” services for well- known profiles New applications can publish own GUID Services usually chosen through device UI

Step 5: Transfer Data Point to point style 2-way communication Applications use service/profile protocols to communicate effectively

Agenda Technology Overview Bluetooth Application Concepts Windows CE Development Windows Mobile Development DemoQ&A

Bluetooth Application Programming Winsock API is extended to support Bluetooth New Protocol Family for Bluetooth AF_BTH New Protocol Option BTPROTO_RFCOMM New socket options for Bluetooth Enable/disable encryption Control send/receive buffer size Set power level

Windows CE: Native Approach Windows Sockets APIs Device and Service Discovery: WSALookupServiceBegin(), WSALookupServiceNext(), WSALookupServiceEnd() Use standard socket connection APIs bind(), listen(), accept(), connect() Data Transfer APIs send(), recv()

Bluetooth Enabling Legacy Applications Useful for applications built around interfacing with serial devices GPS receivers, barcode scanners, etc. Virtual serial ports expose Bluetooth link as a COM port Legacy application remains untouched Limited number of COM ports available on device

Agenda Technology Overview Bluetooth Application Concepts Windows CE Development Windows Mobile Development DemoQ&A

Bluetooth Application Development On Windows Mobile Native Can leverage WinCE Winsock APIs Windows Mobile specific utility methods BthGetMode()/BthSetMode() Managed Code Bluetooth Class Library

Windows Mobile: Managed Approach Use UI for pairing Publish Service new BluetoothService( GUID ) List of Paired Devices BluetoothRadio.PairedDevices Connect to a service BluetoothDevice.Connect( GUID ) Use NetworkStream objects for data transfer

Windows Mobile Managed Approach Benefits Simplicity Intuitive class interface for all levels of managed developers Focus on the application, not on the technology Easy to build custom services Leverage NETCF APIs for object serialization Flexible, high level networking APIs Powerful NetworkStream class Rich threading support Shared Source Add and change under the hood

Agenda Technology Overview Bluetooth Application Concepts Windows CE Development Windows Mobile Development DemoQ&A

Conclusion Bluetooth is a ubiquitous, powerful ad- hoc networking technology Rich support on Windows CE and Windows Mobile Windows Sockets API Managed Class Library for Windows Mobile Leverage Visual Studio 2005 for native and managed development

While at MEDC 2005… Fill out an evaluation for this session Randomly selected instant WIN prizes! Randomly selected instant WIN prizes! Use real technology in a lab Instructor led Reef E/F & Breakers L Self-paced Reef B/C Self-paced Reef B/C Visit the Microsoft Product Pavilion in the Exhibit Hall Shorelines B in the Exhibit Hall Shorelines B

After The Conference… Develop Build InstallBuildJoin Install Enter Enter Join Full-featured trial versions of Windows CE and/or Windows XP Embedded Cool stuff & tell us about it: msdn.microsoft.com/embedded/community msdn.microsoft.com/embedded/community Windows Embedded Partner Program: Windows Mobile 5.0 Eval Kit including Visual Studio 2005 Beta 2 Mobile2Market Contest and win up to $25000: mobile2marketcontest.com mobile2marketcontest.com Microsoft Solutions Partner Program: partner.microsoft.com partner.microsoft.com

Tools & Resources msdn.microsoft.com/ embedded microsoft.public. windowsxp.embedded windowsce.platbuilder windowsce.platbuilder windowsce.embedded.vc windowsce.embedded.vc blogs.msdn.com/ mikehall Windows CE 5.0 Eval Kit Windows XP Embedded Eval Kit msdn.microsoft.com/ mobility microsoft.public. pocketpc.developer smartphone.developer dotnet.framework.compactframework blogs.msdn.com/ windowsmobile vsdteam netcfteam Windows Mobile 5.0 Eval Kit Websites Newsgroups Blogs Tools Build Develop

Q&A

© 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Appendix

Link Properties Asynchronous Connection-Less (ACL) 721/57.6 kbps max asymmetric kbps max symmetric Synchronous Connection-Oriented (SCO) Symmetric Point-to-point channel Used for voice channels 64 kbps bi-directional data streams ACL and SCO can be present in a single piconet Data transmitted in Time Divided Slots

Bluetooth v1.2 Faster connection Adaptive frequency hopping Extended SCO links Scatter mode Enhanced error detection and flow control

Bluetooth Piconet / Scatternet Piconet Master controls piconet, hopping sequence and phase Up to 7 active slaves Up to 127 “parked” slaves Node must be part of a piconet to communicate Master tells slave when it can transmit Piconets can chain together and form a larger network ( Scatternet ) M S S S M S

Bluetooth Services (Profiles) Supported in CE GAP SPP DUN LAP GOEP OPP FTP HS HF HID PAN General Access Profile Serial Port Profile Dialup Networking Profile LAN Access Profile General Object Exchange Profile Object Push Profile File Transfer Profile Headset Profile Handsfree Profile Human Input Device Profile Personal Area Network Profile

Bluetooth Enabling Legacy Applications: Registering COM ports PORTEMUPortParams pp; memset( &pp, 0, sizeof( pp ) ); // connect to serial port profile on device identified by // remoteDeviceAddr pp.device = remoteDeviceAddr; pp.uuidService = SerialPortServiceClass_UUID; pp.uiportflags = RFCOMM_PORT_FLAGS_REMOTE_DCB; HANDLE h = RegisterDevice (L"COM", index, L"btd.dll", (DWORD)&pp);

Bluetooth Enabling Legacy Applications: Serial Data Transfer WCHAR szComPort[30]; // open previously registered COM port for reading and writing wsprintf( szComPort, L"COM%d:", index ); HANDLE hCommPort = CreateFile( szComPort, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL ); WriteFile( hCommPort, …); ReadFile( hCommPort, …); // cleanup CloseHandle( hCommPort ); DeregisterDevice( h );

Bluetooth Creating a socket SOCKET s = socket (AF_BT, SOCK_STREAM, BTHPROTO_RFCOMM);

Bluetooth Connecting a socket SOCKADDR_BTH sa; memset (&sa, 0, sizeof(sa)); sa.addressFamily = AF_BT; sa.btAddr = b; sa.port = channel; connect (s, (SOCKADDR*)&sa, sizeof(sa));

Bluetooth Listening on a socket SOCKADDR_BTH sa; memset (&sa, 0, sizeof(sa)); sa.addressFamily = AF_BT; sa.port = BT_PORT_ANY; bind (server, (SOCKADDR *)&sa, sizeof(sa); getsockname(server, (SOCKADDR *)&sa, &namelen); listen (server, 5); SOCKET s2 = accept (server, (SOCKADDR *)&sa2, &size);

Bluetooth getsockname Use getsockname to retrieve server channel allocated to socket by a call to bind and Bluetooth address of local device. SOCKADDR_BTH sab; int len = sizeof(sab); if (0 == getsockname (s, &sab, &len)) { wprintf (L”Local Bluetooth device is %04x%08x, server channel = %d\n”, GET_NAP(sab.btAddr), GET_SAP(sab.btAddr), sab.port); }

Bluetooth getpeername Use getpeername on connected socket to retrieve Bluetooth address of peer Bluetooth device. SOCKADDR_BTH sab; int len = sizeof(sab); if (0 == getpeername (s, &sab, &len)) { wprintf (L”Remote Bluetooth device is %04x%08x, connected to %d\n”, GET_NAP(sab.btAddr), GET_SAP(sab.btAddr), sab.port); }

Bluetooth getsockopt Queries various parameters associated with server channel or connection. The parameters are as follows: s must be Bluetooth socket level must be SOL_RFCOMM SO_BTH_GET_MTU_MAX,…

Bluetooth setsockopt Configures various parameters associated with server channel or connection. The parameters are as follows: s must be Bluetooth socket level must be SOL_RFCOMM SO_BTH_AUTHENTICATE, SO_BTH_ENCRYPT, …

Bluetooth Discovering Devices WSAQUERYSETwsaq; wsaq.dwNameSpace = NS_BTH; WSALookupServiceBegin (&wsaq, LUP_CONTAINERS, &hLookup); WSALookupServiceNext (hLookup, LUP_RETURN_ADDR, &dwSize, pwsaResults); pNew->b = ((SOCKADDR_BTH *)pwsaResults- >lpcsaBuffer->RemoteAddr.lpSockaddr)- >btAddr

Bluetooth Querying for names Change WSALookupServiceNext to WSALookupServiceNext (hLookup, LUP_RETURN_NAME | LUP_RETURN_ADDR, &dwSize, pwsaResults) … wcscpy (pRes->szName, pwsaResults- >lpszServiceInstanceName);