Application Note
R01AN6004EJ0100 Rev.1.00 Page 1 of 78
Aug.31.21
Bluet oot h LE microcompute r / module
Windows 10 Bluetooth LE Application
Introduction
This application note explains the operation and processing flow of the Bluetoo th LE API of Windo ws
®
10
API using the Windows 10 Bluetooth LE application that can wirelessly communicate with an evaluation
board equipped with a Renesas Electronics Bluetooth
®
Low Energy technology compatible microcomputer or
module.
Bluetooth LE applications that run on Windows 10 are created in Microsoft Visu al Stud io Expr es s 20 17 for
Windows Desktop as Windows Presentation Foundation (WPF) applications for the .NET Framework to pair,
connect, search for services and characteristics, and communicate data.
Target Device
Target Board for RX23W
Target Board for RX23W module
EK-RA4W1
EB-RE01B
RL78/G1D Evaluation Board (RTK0EN0001D01001BZ)
Related Documents
RX23W Group
ï‚Ÿ RX23W Group Target Board for RX23W Quick Start Guide (R20QS0014)
ï‚Ÿ RX23W Group Target Board for RX23W User's Manual (R20UT4634)
ï‚Ÿ RX23W Group Target Board for RX23W module Quick Start Guide (R20QS0022)
ï‚Ÿ RX23W Group Target Board for RX23W module User's Manual (R20UT4890)
RA4W1 Group
ï‚Ÿ RA4W1 Group Ev al uat ion Kit for RA4 W1 Micr oc ontro ll er Group EK-RA4W1 Quick S tart Guide
(R20QS0015)
ï‚Ÿ RA4W1 Group EK-RA4W1 User's Manual (R20UT4683)
RE01B Group
ï‚Ÿ EB-RE01B Hardware Manual (TS-TUM09734) (TESSERA TECHNOLOGY INC.)
ï‚Ÿ RE01B Group Bluetooth Low Energy Sample code (using CMSIS Driver Package) (R01AN5606)
RL78/G1D Group
ï‚Ÿ Bluetooth
®
Low Energy Protocol Stack Virtual UART Application (R01AN3130)
ï‚Ÿ Bluetooth
®
Low Energy Protocol Stack Quick Start Guide (R01AN2767)
ï‚Ÿ RL78/G1D Evaluation Board User's Manual (R30UZ0048)
The Bluetooth
®
word mark and logos are registered trademarks owned by Bluetooth SIG, Inc. and any use of
such marks by Renesas Electronics Corporation is under license. Other trademarks and registered
trademarks are the property of their respective owners.
Windows, W ind ows 10 and Visual Studio are registered trademarks or trademarks of Microsoft Corporation
in the United States and/or other countries.
Bluetooth LE microcomputer / module Windows 10 Blue too t h LE Application
R01AN6004EJ0100 Rev.1.00 Page 2 of 78
Aug.31.21
Contents
1. Overview ................................................................................................................................. 5
1.1 LED Switch Service Client ....................................................................................................................... 6
1.2 Virtu al U ART C l ient ................................................................................................................................. 6
2. Operation Check ...................................................................................................................... 7
2.1 Executable File ........................................................................................................................................ 7
2.1.1 LED Switch Service Client ..................................................................................................................... 7
2.1.2 Virtu al U ART C l ient ............................................................................................................................... 7
2.2 Windows Ap pl icati on Specificati on .......................................................................................................... 8
2.2.1 LED Switch Service Client ..................................................................................................................... 8
2.2.2 Virtu al U ART C l ient ............................................................................................................................. 10
2.3 Preparation of Operation Check Environment ...................................................................................... 12
2.3.1 Windows PC ........................................................................................................................................ 12
2.3.2 Target Board for RX23W ..................................................................................................................... 12
2.3.3 Target Board for RX23W module ........................................................................................................ 12
2.3.4 EK-RA4W1 .......................................................................................................................................... 12
2.3.5 EB-RE01B ........................................................................................................................................... 12
2.3.6 RL78/G1D Evaluation Board (RTK0EN0001D01001BZ) .................................................................... 13
2.4 Operation Check .................................................................................................................................... 14
2.4.1 Operation check using LED Switch Service Client.............................................................................. 14
2.4.2 Operation ch ec k using Virtual UART Cl ient ........................................................................................ 20
3. Build ...................................................................................................................................... 27
3.1 Build Environment Setup ....................................................................................................................... 27
3.1.1 Install Visua l Stud io 20 17 .................................................................................................................... 27
3.1.2 Install Window s 10 SDK ...................................................................................................................... 30
3.2 File Structur e ......................................................................................................................................... 33
3.2.1 LED Switch Service Client ................................................................................................................... 33
3.2.2 Virtu al U ART C l ient ............................................................................................................................. 33
3.3 Build Windows Application .................................................................................................................... 34
4. Implementation Details .......................................................................................................... 35
4.1 Program file of Wi ndows ap plica tio n ..................................................................................................... 35
4.2 Use Bluetooth LE API of UWP with WPF .............................................................................................. 35
4.3 LED Switch Service Client ..................................................................................................................... 36
4.3.1 MainWindow class ............................................................................................................................... 36
4.3.1.1 Field (Member variable) .................................................................................................................... 36
4.3.1.2 Constructor ........................................................................................................................................ 37
4.3.1.3 Method/ Event han dl er ....................................................................................................................... 38
4.3.2 AdvertisementWatcherInformation class ............................................................................................. 43
4.3.2.1 Property ............................................................................................................................................. 43