internet of things with bluetooth - developer skill sprint with david i

Post on 18-Nov-2014

669 Views

Category:

Technology

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

This is the slide deck used in the September 18, 2014 Developer Skill Sprint - Internet of Things with Bluetooth by David Intersimone "David I"

TRANSCRIPT

EMBARCADERO TECHNOLOGIESEMBARCADERO TECHNOLOGIES

Internet of Thingswith Bluetooth

David Intersimone “David I”davidi@embarcadero.com

Blog: http://embt.co/SipFromTheFirehoseTwitter: @davidi99

Thursday, 18th of September, 2014

Download a free trial – NOW!http://embt.co/trialdownloads

EMBARCADERO TECHNOLOGIES

This Skill Sprint Works with . . .

• Windows• OS X• Android• iOS• RAD Studio• Appmethod• Object Pascal• C++

• RAD Studio XE7 DocWiki– http://embt.co/latestdocwiki

• Appmethod September 2014 Release DocWiki– http://embt.co/AppmethodTopics

• Appmethod supports the FireMonkey framework on all 4 platforms while RAD Studio, Delphi and C++Builder also supports VCL on Windows. Contact sales with any questions!

EMBARCADERO TECHNOLOGIES

How Skill Sprints Work. - Agenda

• READY– Tips tricks & short URLS

• SET– 20 minutes, 1 topic

• GO– Demo and discussion– Live Q&A

Download a free trial – NOW!http://embt.co/trialdownloads

EMBARCADERO TECHNOLOGIES

Bluetooth support in XE7• RTL new unit: System.Bluetooth, System::Bluetooth• Multi-device API for Classic Bluetooth & Bluetooth LE• TBluetoothLE component• Classic Bluetooth classes– TBluetoothManager– TBluetoothAdapter– TBluetoothDevice

EMBARCADERO TECHNOLOGIES

Bluetooth and App Tethering

• To implement Classic Bluetooth support in your VCL and FMX apps:– Obtain an instance of TBluetoothManager.– Discover remote devices and pair with them.– Connect to the paired devices.– Exchange data with the connected devices.

EMBARCADERO TECHNOLOGIES

BluetoothLE and Devices• Use an instance of TBluetoothLEDevice to:

– Discover services that the remote device provides– Obtain detailed info including the characteristics

• Read and Write a characteristic value• Ask to be notified of changes in a Characteristic value

– SetCharacteristicNotification method– OnCharacteristicRead event handler

• Get the received signal strength indicator (RSSI)

• To obtain an instance of TBluetoothLEDevice– Use the StartDiscovery method or LastDiscoveredDevices property

EMBARCADERO TECHNOLOGIES

TBluetoothLE Component• Discovery

– DiscoverDevices– DiscoverServices

• Working with devices and services– DiscoveredDevices– OnEndDiscoverDevices– OnEndDiscoverServices– SetCharacteristicNotification– OnCharacteristicRead, OnCharacteristicReadRequest– OnCharacteristicWrite, OnCharacteristicWriteRequest– OnReadRSSI

EMBARCADERO TECHNOLOGIES

BluetoothLE GATT-based Profile Hierarchy• Generic Attribute Profile (GATT)

– Services are collections of characteristics and relationships to other services that encapsulate the behavior of part of a device

– https://developer.bluetooth.org/gatt/Pages/GATT-Specification-Documents.aspx

• If device is not GATT– Try using discovery– Contact the device manufacturer

EMBARCADERO TECHNOLOGIES

DEMONSTRATIONSAPP TETHERING, HEART RATE

Bluetooth support in XE7

EMBARCADERO TECHNOLOGIES

Bluetooth Resources

• Bluetooth samples that are included in XE7– C++

• C:\Users\Public\Documents\Embarcadero\Studio\15.0\Samples\CPP\Mobile Samples\Device Sensors and Services\Bluetooth• C:\Users\Public\Documents\Embarcadero\Studio\15.0\Samples\CPP\RTL\Tethering

– Object Pascal• C:\Users\Public\Documents\Embarcadero\Studio\15.0\Samples\Object Pascal\Mobile Samples\Device Sensors and Services\Bluetooth• C:\Users\Public\Documents\Embarcadero\Studio\15.0\Samples\Object Pascal\RTL\Tethering

• Bluetooth and App Tethering– http://docwiki.embarcadero.com/RADStudio/XE7/en/Using_Bluetooth– http://docwiki.embarcadero.com/RADStudio/XE7/en/Using_Classic_Bluetooth– http://docwiki.embarcadero.com/RADStudio/XE7/en/Using_App_Tethering

• Bluetooth.org– https://developer.bluetooth.org/– https://developer.bluetooth.org/TechnologyOverview/Pages/BLE.aspx– https://developer.bluetooth.org/TechnologyOverview/Pages/GATT.aspx– https://developer.bluetooth.org/gatt/Pages/GATT-Specification-Documents.aspx

Download a free trial – NOW!http://embt.co/trialdownloads

EMBARCADERO TECHNOLOGIES

Next Time….• Aspect-oriented Programming using DSharp

with Nick Hodges• “Coding in Delphi” - https://leanpub.com/codingindelphi• Tuesday the 23rd of September

– 6AM San Francisco / 9AM New York / 2PM London / 3PM Milan– 11AM San Francisco / 2PM New York / 7PM London / 8PM Milan– 5PM San Francisco / Fri 9AM Tokyo / Fri 10AM Sydney

See the full schedule - http://embt.co/Sprints14 Download your free trial now! - http://embt.co/trialdownloads

EMBARCADERO TECHNOLOGIESEMBARCADERO TECHNOLOGIES

Q & A

Download your free trial now! http://embt.co/trialdownloads

@EmbarcaderoTech

top related