Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin...

35
Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power Systems Designer Mangan Inc

Transcript of Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin...

Page 1: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Bluetooth LEw/ Android, iOS, and Windows Phone

Jared RhodesSenior Consultant, MCSD, Xamarin Certified DeveloperMagenic Atlanta

Marshall StewartPower Systems Designer

Mangan Inc

Page 2: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

Overview• Bluetooth LE Overview (Bluetooth 4.0 / Bluetooth Smart)• Bluetooth Hardware and Debugging Tools• Xamarin Forms

– Android– iOS– Windows Phone

Page 3: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

What is Bluetooth LE• AKA Bluetooth Smart / Bluetooth 4.0• Bit rate is 1Mbit/s, and the maximum transmit power is 10 mW• Max Range <100 m• Number of Children restrictions removed• New GAP and GATT Layers

Page 4: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

Introduction to Bluetooth Smart

Page 5: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

Packet Structure changes

Page 6: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

Packet Structure Design• Advertising Packet

• Data Packet

Page 7: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

Link Layer• 3 Advertising channels• 37 Data channels

Page 8: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

Hardware Configurations

Page 9: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

Page 11: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

What is GAP• Generic Access Profile • Roles –

– Broadcaster – an advertiser that is non-connectable– Observer – scans for advertisements, but cannot initiate connections– Central – scans for advertisements and initiates connections; operates

as a master in a single or multiple link-layer connections. Currently, the BLE central stack supports up to three simultaneous connections.

– Peripheral – an advertiser that is connectable, and operates as a slave in a single link-layer connection.

Page 12: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

What is GATT• Generic Attribute Profile (GATT)• Terminology:

– Client - A device that initiates GATT commands and requests, and accepts responses, for example a computer or smartphone.

– Server - A device that receives GATT commands and requests, and returns responses, for example a temperature sensor.

– Characteristic - A data value transferred between client and server, for example the current battery voltage.

Page 13: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

What is GATT• Terminology (cont)

– Service - A collection of related characteristics, which operate together to perform a particular function. For instance, the Health Thermometer service includes characteristics for a temperature measurement value, and a time interval between measurements.

– Descriptor - A descriptor provides additional information about a characteristic. For instance, a temperature value characteristic may have an indication of its units (e.g. Celsius), and the maximum and minimum values which the sensor can measure. Descriptors are optional - each characteristic can have any number of descriptors.

Page 14: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

What is GATT• Terminology (cont)

– Identifiers - Services, characteristics, and descriptors are collectively referred to as attributes, and identified by UUIDs. Any implementer may pick a random or pseudorandom UUID for proprietary uses, but the Bluetooth SIG have reserved a range of UUIDs (of the form xxxxxxxx-0000-1000-8000-00805F9B34FB) for standard attributes. For efficiency, these identifiers are represented as 16-bit or 32-bit values in the protocol, rather than the 128 bits required for a full UUID. For example, the Device Information service has the short code 0x180A, rather than 0000180A-1000-... . The full list is kept in the Bluetooth Assigned Numbers document online.

Page 15: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

Example of a service

Page 16: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

Bluetooth LE Hardware• Energy efficiency is the primary design concern

– 4 second connection interval draws 4μA– 2μA standby current between connection events– 500nA deep sleep mode– 11mA Tx and 12.5mA Rx current at peak 0dBm output

Page 17: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

Manufacturers of the BT technology• BlueRadios• Broadcom• Cambridge Silicon Radio (CSR)• connectBlue• Dialog Semiconductor• ISSC Technologies• Nordic Semiconductor• Stollmann• Texas Instruments• Cypress Semiconductor

Page 18: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

Used for this demo

Page 19: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

Xamarin Forms - Pages

Page 20: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

Xamarin Forms - Layouts

Page 21: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

Xamarin Forms - Controls

Page 22: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

App Lifcycle

Page 23: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

Styles

Page 24: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

Styles

Page 25: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

Styles

Page 26: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

Behaviors

Page 27: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

Triggers

Page 28: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

Triggers

Page 29: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

Controls Vendors

Page 30: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

Control Vendors – as of 3/15/2015• Syncfusion –

– Chart– Treeview– Circular, Digital, Linear Gauges– Excel, Word, and PDF

• Telerik– Chart– Calendar

Page 31: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

Control Vendors – as of 3/15/2015• Steema – TeeChart• Component One –

– Flexchart– FlexPie– Gauges

• DevExpress – Grid• Infragistics – Grid and Charts (I think, didn’t download trial)

Page 32: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

Xamarin Forms Labs• GitHub• Controls• Services• MVVM Helpers• Plugins

– DI– Caching– Charting

Page 34: Bluetooth LE w/ Android, iOS, and Windows Phone Jared Rhodes Senior Consultant, MCSD, Xamarin Certified Developer Magenic Atlanta Marshall Stewart Power.

Atlanta

Internet of Things with Azure and Bluetooth Smart

Tuesday, April 21, 2015