28
labs.mediatek.com Philip Handschin Technical Consultant Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

Embed Size (px)

Citation preview

Page 1: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

labs.mediatek.com

Philip Handschin Technical Consultant

Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

Page 2: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

Topics

2

WHAT IS MEDIATEK LABS HDK

Overview of GATT

Hello World example

Read temperature example

Questions

Page 3: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

MediaTek Labs A Developer Centric Ecosystem

Global program – free to join

Supporting developers: Device creation

App development

Services

labs.mediatek.com

Page 4: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

2016-03-08 Copyright © MediaTek Inc. All rights reserved. 4

Enabling Developer and Maker Success

Dev resources

Insights and inspiration

Access to hardware

SDKs for makers (Arduino), professional developers (C/Eclipse) and Linux (OpenWrt and Ubuntu)

Technical support

Peripherals (sensors, etc)

Cloud management of device data

Developer advice & matchmaking

Design, production & go-to-market help

Go from idea to prototype to product

Page 5: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

MediaTek LinkIt™ portfolio Software and hardware development platforms for wearables & IoT

Copyright © MediaTek Inc. All rights reserved.

LinkIt Assist 2502 labs.mediatek.com/2502

Wearable form factors

For professional developers (C/Eclipse)

LinkIt ONE

labs.mediatek.com/linkitone

Unrivalled connectivity on a single board

For DIY & maker community (Arduino)

LinkIt Connect 7681 labs.mediatek.com/7681

The simple way to Wi-Fi enable your devices

For low-cost smart home or office deployment

LinkIt Smart 7688 labs.mediatek.com/7688

Open-source Wi-Fi platform for a more connected world

OpenWrt Linux, Python, Node.js, Arduino

Page 6: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

2016-03-08 Copyright © MediaTek Inc. All rights reserved. 6

Rapidly growing LinkIt community

Page 7: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

Topics

7

What is MediaTek Labs

HDK Overview of GATT

Hello World example

Read temperature example

Questions

Page 8: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

LinkIt ONE HDK (Back View)

GPS Antenna

Wi-Fi / BT Antenna

GSM Antenna

GPS+GLONASS Antenna

Wi-Fi / BT Antenna

GSM Antenna

Page 9: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

Topics

9

What is MediaTek Labs

HDK

OVERVIEW OF GATT Hello World example

Read temperature example

Questions

Page 10: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

GATT

10

▪ GATT = Generic Attribute Profile

▪ Gatt prescibes how to send/receive data

▪ It’s reading writing attributes on the devices

• 4 different ways of transfering data

▪ 22 Bytes / transaction

Page 11: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

Network topology

11

Central Device (Phone, Tablet,

Computer)

Peripheral Device

Peripheral Device

Peripheral Device

Peripheral Device

Peripheral device can only have one

connection at a time

Central Device can have multiple

connections at a time

Page 12: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

Roles

12

▪ Server

• Sends notification that new data is available

▪ Client

• Receives data

▪ Peripheral and Central Device can be both

Server Client

Page 13: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

Services and characteristics

13

▪ Services are collections of characteristics

▪ Characteristics store values and permissions

▪ Heart rate monitor

• Heartbeat (Read)

• Timestamp (Read/Write)

Profile

Service

Characteristic

Characteristic

Service

Characteristic

Characteristic

Characteristic

Page 14: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

UUID

14

▪ implement as many profiles, services, and characteristics as you need.

▪ non-standard profile -> 128bit UUID is required and must be generated randomly by

▪ Bluetooth SIG profiles -> 16bit UUID (services, and characteristics) currently

Page 15: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

BT SIG UUID’s

15

▪ List of set standard UUID as examples

▪ Service UUID • Battery Service 0x180F

• Running Speed and Cadence 0x1814

▪ Characteristic • Glucose Measurement 0x2A18

• Heart Rate Measurement 0x2A37

▪ https://developer.bluetooth.org/gatt/Pages/default.aspx

Page 16: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

Data Transfer - types

16

▪ Read –requested by client Server responds with value.

▪ Write – requested by client Server stores the new value

▪ Notify – initiated by the server when a new value is written, then the new value is pushed to the client (Notifications are not acknowledged)

▪ Indicate – same as Notify but indications are acknowledged

Page 17: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

Data Transfer - application

17

▪ If the client needs to send data to the server, use write.

▪ If the client needs to get data from the server on-demand (i.e. polling), use read.

▪ If the server needs to send data to the client without the client requesting it first, use notify or indicate. (The client must subscribe to these updates before any data will be transferred.)

Page 18: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

Topics

18

What is MediaTek Labs

HDK

Overview of GATT

HELLO WORLD EXAMPLE Read temperature example

Questions

Page 19: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

Hello World example

19

▪ Create a server

• Service

• Characteristic

▪ Handle read request from client

• “Hello GATT world!”

Page 20: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

Client Server

20

Client Server

Read

“Hello world!”

Page 22: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

Hello World Example

22

1. Implement an LGATTService

2. Implement the onRead() function

3. Initialize the LGATTServer with your implementation

4. Handle incoming requests

Page 23: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

Temperature Example

23

1. Implement an LGATTService

2. Initialize the LGATTServer with your implementation

3. Read temperature

4. If temperature changed, send indication to Client

Page 24: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

Best Practice

24

▪ Start on our example code

▪ Arduino

• File

▪ Examples • LGATT

▪ UARTOverGATT

• LGATTS

Page 25: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

Topics

25

What is MediaTek Labs

HDK

Overview of GATT

Hello World example

Read temperature example

QUESTIONS

Page 26: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

Questions?

26

Download Resources:

labs.mediatek.com/linkit

MediaTek Cloud Sandbox:

labs.mediatek.com/mcs

Check the Forum:

labs.mediatek.com/forums

Page 27: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

What’s Next ?

27

▪ March 17th, 2016 - From concept to consumer – make your IoT idea a commercial reality

More Info : http://home.labs.mediatek.com/march-

webinars-make-the-most-out-of-your-iot-project/

Page 28: Bluetooth Low Energy communication with MediaTek LinkIt™ ONE

Copyright © MediaTek Inc. All rights reserved.