SlideShare una empresa de Scribd logo
1 de 69
Descargar para leer sin conexión
Eddystone Beacons Demo
Lecture on Eddystone, an open Bluetooth Smart Beacon format
from Google
+Angelo Rüggeberg
@s3xy4ngyc
agenda
- Introductions to Beacons
- Introduction to Eddystone
- Coding Session
Introduction to Beacons
Image: Google
Context or
exact Location
Location, Accuracy,
Range, and alike
Image: Google
…
Use Cases
Image: Estimote
Opportunities
Presence (e.g. sights)
Image: Google
Opportunities
Tracking and Securing
Image: Google
Opportunities
• Contextual fencing
(aka Geo-fence)
• Contextual content
(e.g. reader circle)
• …
Image: Bundesarchiv
Landscape
• AltBeacon
• Apple‘s property: iBeacon™
• Estimote
• Gimbal™
• PayPal™ Beacon
• yoints
• …
• Bluetooth® SIG
(Special Interest Group)
• Bluetooth® Smart Beacon
• Eddystone™
• https://github.
com/google/eddystone/tree/mast
er/branding
Introduction to Eddystone
Eddystone™, what’s so special?
Openness
• It is an open Bluetooth 4.0 protocol
• While iBeacon™ is officially
supported by iOS devices only,
Eddystone™ has official support
for both iOS and Android
Packet types / frames
• Eddystone-UID (identifier)
• Namespace as UUID
• Instance (6 bytes), much like Major
and Minor
• Eddystone-URL
• Eddystone-TLM (telemetry)
• battery voltage
• temperature
• number of packets since last reboot
• beacon uptime since last reboot
Hardware
Phones can become Smart Beacons
themselves
• TxEddystone-UID (Android Lollipop 5.0)
Almost all devices with BLE can
become Smart Beacons themselves
• BlueGiga BLED112 Dongle
• Cambridge Silicon Radio CSR1010 (Beacon
Development Board)
• Rfduino
• Linux (bluez)
• ARM mbed (Nordic nRF51-dongle, nRF51-DK)
• Node.js (node-eddystone-beacon using
bleno)
• Arduino (BLEPeripheral), using Nordic
Semiconductor's nRF8001 or nR51822
https://github.
com/google/eddystone/tree/master/eddyst
one-uid/tools/txeddystone-uid
Some Bluetooth® Facts
• Bluetooth / BLE
is a wireless protocol
• Bluetooth uses UHF radio waves in
the ISM band from 2.4 to
2.485 GHz divided into channels
with frequency hopping
• Signal strength is an indicator for
proximity (RSSI, received signal
strength indicator)
• BLE has reduced power
consumption
• Bluetooth SIG predicts more than
90% of Bluetooth-enabled
smartphones will support the low
energy standard by 2018.
Coding a Simple BLE Scanner
Prerequisites
• Real device with BLE (emulator has
no Bluetooth™ support)
• Alternative emulator http:
//stackoverflow.
com/questions/20348743/blue
tooth-low-energy-on-android-
emulator/27712017
• Android 4.3 (Jelly Bean, API Level
18)
• Android 4.4.4 (KitKat, API Level
19) fixes some issues (e.g.
https://code.google.
com/p/android/issues/detail?
id=67272)
• Android 5.0 (Lollipop, API Level
21) recommended due to some
API changes (e.g.
Advertisement and LE Scanner)
BLE Permissions for an App
•
<!– Allow any Bluetooth communication -->
<uses-permission android:name="android.permission.BLUETOOTH"/>
<!– Allow device discovery -->
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
•
<uses-feature
android:name="android.hardware.bluetooth_le"
android:required="true“
/>
•
•
•
•
•
•
public class MainActivity extends AppCompatActivity {
// Declare Bluetooth adapter
private BluetoothManager bluetoothManager;
private BluetoothAdapter bluetoothAdapter;
public class MainActivity extends AppCompatActivity {
// Declare Bluetooth adapter
private BluetoothManager bluetoothManager;
private BluetoothAdapter bluetoothAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Initialize Bluetooth adapter
bluetoothManager = (BluetoothManager) getSystemService(Context.
BLUETOOTH_SERVICE);
bluetoothAdapter = bluetoothManager.getAdapter();
…
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Initialize Bluetooth adapter
bluetoothManager = (BluetoothManager) getSystemService(Context.
BLUETOOTH_SERVICE);
bluetoothAdapter = bluetoothManager.getAdapter();
…
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Initialize Bluetooth adapter
bluetoothManager = (BluetoothManager) getSystemService(Context.
BLUETOOTH_SERVICE);
bluetoothAdapter = bluetoothManager.getAdapter();
…
bluetoothAdapter.startLeScan(new BluetoothAdapter.LeScanCallback() {
@Override
public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) {
Log.d(TAG, "Device-Adress: " + device.getAddress());
Log.d(TAG, "RSSI: " + rssi);
}
});
bluetoothAdapter.startLeScan(new BluetoothAdapter.LeScanCallback() {
@Override
public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) {
Log.d(TAG, "Device-Adress: " + device.getAddress());
Log.d(TAG, "RSSI: " + rssi);
}
});
bluetoothAdapter.startLeScan(new BluetoothAdapter.LeScanCallback() {
@Override
public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) {
Log.d(TAG, "Device-Adress: " + device.getAddress());
Log.d(TAG, "RSSI: " + rssi);
}
});
bluetoothAdapter.startLeScan(new BluetoothAdapter.LeScanCallback() {
@Override
public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) {
Log.d(TAG, "Device-Adress: " + device.getAddress());
Log.d(TAG, "RSSI: " + rssi);
}
});
bluetoothAdapter.startLeScan(new BluetoothAdapter.LeScanCallback() {
@Override
public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) {
if(device.getAddress().equals("C1:4F:F1:FF:9B:90")) {
Log.d(TAG, "Device-Adress: " + device.getAddress());
Log.d(TAG, "RSSI: " + rssi);
}
}
});
bluetoothAdapter.startLeScan(new BluetoothAdapter.LeScanCallback() {
@Override
public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) {
if(device.getAddress().equals("C1:4F:F1:FF:9B:90")) {
Log.d(TAG, "Device-Adress: " + device.getAddress());
Log.d(TAG, "RSSI: " + rssi);
}
}
});
Move away from deprecated Methods
bluetoothLeScanner = bluetoothAdapter.getBluetoothLeScanner();
bluetoothLeScanner.startScan(new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
}
@Override
public void onBatchScanResults(List<ScanResult> results) {
super.onBatchScanResults(results);
}
});
bluetoothLeScanner = bluetoothAdapter.getBluetoothLeScanner();
bluetoothLeScanner.startScan(new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
}
@Override
public void onBatchScanResults(List<ScanResult> results) {
super.onBatchScanResults(results);
}
});
bluetoothLeScanner = bluetoothAdapter.getBluetoothLeScanner();
bluetoothLeScanner.startScan(new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
}
@Override
public void onBatchScanResults(List<ScanResult> results) {
super.onBatchScanResults(results);
}
});
bluetoothLeScanner = bluetoothAdapter.getBluetoothLeScanner();
bluetoothLeScanner.startScan(new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
}
@Override
public void onBatchScanResults(List<ScanResult> results) {
super.onBatchScanResults(results);
}
});
bluetoothLeScanner.startScan(filters, settings, new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
}
});
bluetoothLeScanner.startScan(filters, settings, new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
}
});
ScanSettings settings = new ScanSettings.Builder()
.setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
.build();
List<ScanFilter> filters = new ArrayList<>();
ScanFilter filter = new ScanFilter.Builder()
.setDeviceAddress("C1:4F:F1:FF:9B:90")
.build();
filters.add(filter);
ScanSettings settings = new ScanSettings.Builder()
.setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
.build();
List<ScanFilter> filters = new ArrayList<>();
ScanFilter filter = new ScanFilter.Builder()
.setDeviceAddress("C1:4F:F1:FF:9B:90")
.build();
filters.add(filter);
ScanSettings settings = new ScanSettings.Builder()
.setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
.build();
List<ScanFilter> filters = new ArrayList<>();
ScanFilter filter = new ScanFilter.Builder()
.setDeviceAddress("C1:4F:F1:FF:9B:90")
.build();
filters.add(filter);
ScanSettings settings = new ScanSettings.Builder()
.setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
.build();
List<ScanFilter> filters = new ArrayList<>();
ScanFilter filter = new ScanFilter.Builder()
.setDeviceAddress("C1:4F:F1:FF:9B:90")
.build();
filters.add(filter);
ScanSettings settings = new ScanSettings.Builder()
.setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
.build();
List<ScanFilter> filters = new ArrayList<>();
ScanFilter filter = new ScanFilter.Builder()
.setDeviceAddress("C1:4F:F1:FF:9B:90")
.build();
filters.add(filter);
Coding Proximity and Presence
There is only one packet format for BLE
which
Payload consists of 2 Bytes Header, 6
Bytes Mac Address and up to 31 Bytes
data.
Image: Google
Fixed: 02 01 06 03 03 aa fe
Length: 15
Fixed: 16 aa fe
Frame Type: 00
TX Power: ed
Namespace: ed d1 eb ea c0 4e 5d ef a0 17
Instance: c5 61 2a 8c c2 53
... 04 09
... 45 53 54 03 03
Bat. Service: 0f 18 0e
... 16 0a 18
Mac: 53 c2 8c 2a 61 c5
... 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Fixed: 02 01 06 03 03 aa fe
Length: 11
Fixed: 16 aa fe
Frame Type: 20
Version: 00
Volt: 0c 06
Temo: 13 00
Adv. Count: 00 0f 70 77
Sec. Count: 00 14 4e 70
... 04 09
... 45 53 54 03 03
Bat. Service: 0f 18 0e
... 16 0a 18
Mac: 53 c2 8c 2a 61 c5
... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
// The Eddystone Service UUID, 0xFEAA.
private static final ParcelUuid EDDYSTONE_SERVICE_UUID
= ParcelUuid.fromString("0000FEAA-0000-1000-8000-
00805F9B34FB");
// Eddystone frame types
private static final byte TYPE_UID = 0x00;
private static final byte TYPE_URL = 0x10;
private static final byte TYPE_TLM = 0x20;
// The Eddystone Service UUID, 0xFEAA.
private static final ParcelUuid EDDYSTONE_SERVICE_UUID
= ParcelUuid.fromString("0000FEAA-0000-1000-8000-
00805F9B34FB");
// Eddystone frame types
private static final byte TYPE_UID = 0x00;
private static final byte TYPE_URL = 0x10;
private static final byte TYPE_TLM = 0x20;
// The Eddystone Service UUID, 0xFEAA.
private static final ParcelUuid EDDYSTONE_SERVICE_UUID
= ParcelUuid.fromString("0000FEAA-0000-1000-8000-
00805F9B34FB");
// Eddystone frame types
private static final byte TYPE_UID = 0x00;
private static final byte TYPE_URL = 0x10;
private static final byte TYPE_TLM = 0x20;
// The Eddystone Service UUID, 0xFEAA.
private static final ParcelUuid EDDYSTONE_SERVICE_UUID
= ParcelUuid.fromString("0000FEAA-0000-1000-8000-
00805F9B34FB");
// Eddystone frame types
private static final byte TYPE_UID = 0x00;
private static final byte TYPE_URL = 0x10;
private static final byte TYPE_TLM = 0x20;
// The Eddystone Service UUID, 0xFEAA.
private static final ParcelUuid EDDYSTONE_SERVICE_UUID
= ParcelUuid.fromString("0000FEAA-0000-1000-8000-
00805F9B34FB");
// Eddystone frame types
private static final byte TYPE_UID = 0x00;
private static final byte TYPE_URL = 0x10;
private static final byte TYPE_TLM = 0x20;
•
•
Image: Estimote
bluetoothLeScanner.startScan(filters, settings, new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID);
byte frameType = data[0];
if (frameType != TYPE_TLM) {
return;
}
// Beacon temperature
double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() /
256.0;
Log.d(TAG, String.format("%.2f°C", temp));
}
});
bluetoothLeScanner.startScan(filters, settings, new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID);
byte frameType = data[0];
if (frameType != TYPE_TLM) {
return;
}
// Beacon temperature
double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() /
256.0;
Log.d(TAG, String.format("%.2f°C", temp));
}
});
bluetoothLeScanner.startScan(filters, settings, new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID);
byte frameType = data[0];
if (frameType != TYPE_TLM) {
return;
}
// Beacon temperature
double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() /
256.0;
Log.d(TAG, String.format("%.2f°C", temp));
}
});
bluetoothLeScanner.startScan(filters, settings, new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID);
byte frameType = data[0];
if (frameType != TYPE_TLM) {
return;
}
// Beacon temperature
double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() /
256.0;
Log.d(TAG, String.format("%.2f°C", temp));
}
});
Fixed: 02 01 06 03 03 aa fe
Length: 11
Fixed: 16 aa fe
Frame Type: 20
Version: 00
Volt: 0c 06
Temo: 13 00
Adv. Count: 00 0f 70 77
Sec. Count: 00 14 4e 70
... 04 09
... 45 53 54 03 03
Bat. Service: 0f 18 0e
... 16 0a 18
Mac: 53 c2 8c 2a 61 c5
... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
bluetoothLeScanner.startScan(filters, settings, new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID);
byte frameType = data[0];
if (frameType != TYPE_TLM) {
return;
}
// Beacon temperature
double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() /
256.0;
Log.d(TAG, String.format("%.2f°C", temp));
}
});
bluetoothLeScanner.startScan(filters, settings, new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID);
byte frameType = data[0];
if (frameType != TYPE_TLM) {
return;
}
// Beacon temperature
double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() /
256.0;
Log.d(TAG, String.format("%.2f°C", temp));
}
});
bluetoothLeScanner.startScan(filters, settings, new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID);
byte frameType = data[0];
if (frameType != TYPE_TLM) {
return;
}
// Beacon temperature
double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() /
256.0;
Log.d(TAG, String.format("%.2f°C", temp));
}
});
Outlook and helpers
,
etc.
http://on.google.com/hub/
•
•
• …
•
•
•
•
• …
Image: https://commons.wikimedia.org/wiki/File:Zinkh%C3%BCtter_Hof_Messing_Werkzeuge.jpg

Más contenido relacionado

La actualidad más candente

Droidcon2013 android experience lahoda
Droidcon2013 android experience lahodaDroidcon2013 android experience lahoda
Droidcon2013 android experience lahodaDroidcon Berlin
 
Improving android experience for both users and developers
Improving android experience for both users and developersImproving android experience for both users and developers
Improving android experience for both users and developersPavel Lahoda
 
Google I/O 2021 Recap
Google I/O 2021 RecapGoogle I/O 2021 Recap
Google I/O 2021 Recapfurusin
 
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Webbeyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
beyond tellerrand: Mobile Apps with JavaScript – There's More Than WebHeiko Behrens
 
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with EclipseEclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with EclipseHeiko Behrens
 
Getting physical with web bluetooth in the browser hackference
Getting physical with web bluetooth in the browser hackferenceGetting physical with web bluetooth in the browser hackference
Getting physical with web bluetooth in the browser hackferenceDan Jenkins
 
Getting physical with web bluetooth in the browser
Getting physical with web bluetooth in the browserGetting physical with web bluetooth in the browser
Getting physical with web bluetooth in the browserDan Jenkins
 
Getting Physical with Web Bluetooth in the Browser Full Stack Toronto
Getting Physical with Web Bluetooth in the Browser Full Stack TorontoGetting Physical with Web Bluetooth in the Browser Full Stack Toronto
Getting Physical with Web Bluetooth in the Browser Full Stack TorontoDan Jenkins
 
MDSD for iPhone and Android
MDSD for iPhone and AndroidMDSD for iPhone and Android
MDSD for iPhone and AndroidHeiko Behrens
 
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Ontico
 
Advancing the UI — Part 1: Look, Motion, and Gestures
Advancing the UI — Part 1: Look, Motion, and GesturesAdvancing the UI — Part 1: Look, Motion, and Gestures
Advancing the UI — Part 1: Look, Motion, and GesturesSamsung Developers
 
Adopting 3D Touch in your apps
Adopting 3D Touch in your appsAdopting 3D Touch in your apps
Adopting 3D Touch in your appsJuan C Catalan
 
Demystifying Android's Bluetooth Low Energy at MCE^3 Conf
Demystifying Android's Bluetooth Low Energy at MCE^3 ConfDemystifying Android's Bluetooth Low Energy at MCE^3 Conf
Demystifying Android's Bluetooth Low Energy at MCE^3 ConfPawel Urban
 
MCE^3 - Dariusz Seweryn, Paweł Urban - Demystifying Android's Bluetooth Low ...
MCE^3 - Dariusz Seweryn, Paweł Urban -  Demystifying Android's Bluetooth Low ...MCE^3 - Dariusz Seweryn, Paweł Urban -  Demystifying Android's Bluetooth Low ...
MCE^3 - Dariusz Seweryn, Paweł Urban - Demystifying Android's Bluetooth Low ...PROIDEA
 
Unbreakable: The Craft of Code
Unbreakable: The Craft of CodeUnbreakable: The Craft of Code
Unbreakable: The Craft of CodeJoe Morgan
 
Performance #1: Memory
Performance #1: MemoryPerformance #1: Memory
Performance #1: MemoryYonatan Levin
 
Lviv MDDay 2014. Ігор Коробка “забезпечення базової безпеки в андроїд аплікац...
Lviv MDDay 2014. Ігор Коробка “забезпечення базової безпеки в андроїд аплікац...Lviv MDDay 2014. Ігор Коробка “забезпечення базової безпеки в андроїд аплікац...
Lviv MDDay 2014. Ігор Коробка “забезпечення базової безпеки в андроїд аплікац...Lviv Startup Club
 

La actualidad más candente (20)

Droidcon2013 android experience lahoda
Droidcon2013 android experience lahodaDroidcon2013 android experience lahoda
Droidcon2013 android experience lahoda
 
Improving android experience for both users and developers
Improving android experience for both users and developersImproving android experience for both users and developers
Improving android experience for both users and developers
 
Google I/O 2021 Recap
Google I/O 2021 RecapGoogle I/O 2021 Recap
Google I/O 2021 Recap
 
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Webbeyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
 
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with EclipseEclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Getting physical with web bluetooth in the browser hackference
Getting physical with web bluetooth in the browser hackferenceGetting physical with web bluetooth in the browser hackference
Getting physical with web bluetooth in the browser hackference
 
Getting physical with web bluetooth in the browser
Getting physical with web bluetooth in the browserGetting physical with web bluetooth in the browser
Getting physical with web bluetooth in the browser
 
Getting Physical with Web Bluetooth in the Browser Full Stack Toronto
Getting Physical with Web Bluetooth in the Browser Full Stack TorontoGetting Physical with Web Bluetooth in the Browser Full Stack Toronto
Getting Physical with Web Bluetooth in the Browser Full Stack Toronto
 
MDSD for iPhone and Android
MDSD for iPhone and AndroidMDSD for iPhone and Android
MDSD for iPhone and Android
 
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
 
Advancing the UI — Part 1: Look, Motion, and Gestures
Advancing the UI — Part 1: Look, Motion, and GesturesAdvancing the UI — Part 1: Look, Motion, and Gestures
Advancing the UI — Part 1: Look, Motion, and Gestures
 
Introduction toandroid
Introduction toandroidIntroduction toandroid
Introduction toandroid
 
Adopting 3D Touch in your apps
Adopting 3D Touch in your appsAdopting 3D Touch in your apps
Adopting 3D Touch in your apps
 
Demystifying Android's Bluetooth Low Energy at MCE^3 Conf
Demystifying Android's Bluetooth Low Energy at MCE^3 ConfDemystifying Android's Bluetooth Low Energy at MCE^3 Conf
Demystifying Android's Bluetooth Low Energy at MCE^3 Conf
 
MCE^3 - Dariusz Seweryn, Paweł Urban - Demystifying Android's Bluetooth Low ...
MCE^3 - Dariusz Seweryn, Paweł Urban -  Demystifying Android's Bluetooth Low ...MCE^3 - Dariusz Seweryn, Paweł Urban -  Demystifying Android's Bluetooth Low ...
MCE^3 - Dariusz Seweryn, Paweł Urban - Demystifying Android's Bluetooth Low ...
 
Unbreakable: The Craft of Code
Unbreakable: The Craft of CodeUnbreakable: The Craft of Code
Unbreakable: The Craft of Code
 
Performance #1: Memory
Performance #1: MemoryPerformance #1: Memory
Performance #1: Memory
 
From newbie to ...
From newbie to ...From newbie to ...
From newbie to ...
 
Lviv MDDay 2014. Ігор Коробка “забезпечення базової безпеки в андроїд аплікац...
Lviv MDDay 2014. Ігор Коробка “забезпечення базової безпеки в андроїд аплікац...Lviv MDDay 2014. Ігор Коробка “забезпечення базової безпеки в андроїд аплікац...
Lviv MDDay 2014. Ігор Коробка “забезпечення базової безпеки в андроїд аплікац...
 

Similar a Eddystone beacons demo

A brief overview of BLE on Android
A brief overview of BLE on AndroidA brief overview of BLE on Android
A brief overview of BLE on AndroidLuka Bašek
 
What's new in android jakarta gdg (2015-08-26)
What's new in android   jakarta gdg (2015-08-26)What's new in android   jakarta gdg (2015-08-26)
What's new in android jakarta gdg (2015-08-26)Google
 
Modeveast Appcelerator Presentation
Modeveast Appcelerator PresentationModeveast Appcelerator Presentation
Modeveast Appcelerator PresentationAaron Saunders
 
Building Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture ComponentsBuilding Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture ComponentsHassan Abid
 
Fiware IoT Proposal & Community
Fiware IoT Proposal & Community Fiware IoT Proposal & Community
Fiware IoT Proposal & Community TIDChile
 
Apps development for Recon HUDs
Apps development for Recon HUDsApps development for Recon HUDs
Apps development for Recon HUDsXavier Hallade
 
Programming IoT Gateways in JavaScript with macchina.io
Programming IoT Gateways in JavaScript with macchina.ioProgramming IoT Gateways in JavaScript with macchina.io
Programming IoT Gateways in JavaScript with macchina.ioGünter Obiltschnig
 
Google Wave API: Now and Beyond
Google Wave API: Now and BeyondGoogle Wave API: Now and Beyond
Google Wave API: Now and BeyondMarakana Inc.
 
Тарас Олексин - Sculpt! Your! Tests!
Тарас Олексин  - Sculpt! Your! Tests!Тарас Олексин  - Sculpt! Your! Tests!
Тарас Олексин - Sculpt! Your! Tests!DataArt
 
What's new in Android P @ I/O Extended Bangkok 2018
What's new in Android P @ I/O Extended Bangkok 2018What's new in Android P @ I/O Extended Bangkok 2018
What's new in Android P @ I/O Extended Bangkok 2018Somkiat Khitwongwattana
 
Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)Luc Bors
 
Google analytics
Google analyticsGoogle analytics
Google analyticsSean Tsai
 
Context and Dependency Injection
Context and Dependency InjectionContext and Dependency Injection
Context and Dependency InjectionWerner Keil
 
Serverless Angular, Material, Firebase and Google Cloud applications
Serverless Angular, Material, Firebase and Google Cloud applicationsServerless Angular, Material, Firebase and Google Cloud applications
Serverless Angular, Material, Firebase and Google Cloud applicationsLoiane Groner
 
Exploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptExploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptwesley chun
 
JSR 82 (bluetooth obex)
JSR 82 (bluetooth obex)JSR 82 (bluetooth obex)
JSR 82 (bluetooth obex)SMIJava
 

Similar a Eddystone beacons demo (20)

Android & Beacons
Android & Beacons Android & Beacons
Android & Beacons
 
A brief overview of BLE on Android
A brief overview of BLE on AndroidA brief overview of BLE on Android
A brief overview of BLE on Android
 
What's new in android jakarta gdg (2015-08-26)
What's new in android   jakarta gdg (2015-08-26)What's new in android   jakarta gdg (2015-08-26)
What's new in android jakarta gdg (2015-08-26)
 
Integrando sua app Android com Chromecast
Integrando sua app Android com ChromecastIntegrando sua app Android com Chromecast
Integrando sua app Android com Chromecast
 
Modeveast Appcelerator Presentation
Modeveast Appcelerator PresentationModeveast Appcelerator Presentation
Modeveast Appcelerator Presentation
 
Stmik bandung
Stmik bandungStmik bandung
Stmik bandung
 
Building Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture ComponentsBuilding Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture Components
 
Fiware IoT Proposal & Community
Fiware IoT Proposal & Community Fiware IoT Proposal & Community
Fiware IoT Proposal & Community
 
Night Watch with QA
Night Watch with QANight Watch with QA
Night Watch with QA
 
Apps development for Recon HUDs
Apps development for Recon HUDsApps development for Recon HUDs
Apps development for Recon HUDs
 
Programming IoT Gateways in JavaScript with macchina.io
Programming IoT Gateways in JavaScript with macchina.ioProgramming IoT Gateways in JavaScript with macchina.io
Programming IoT Gateways in JavaScript with macchina.io
 
Google Wave API: Now and Beyond
Google Wave API: Now and BeyondGoogle Wave API: Now and Beyond
Google Wave API: Now and Beyond
 
Тарас Олексин - Sculpt! Your! Tests!
Тарас Олексин  - Sculpt! Your! Tests!Тарас Олексин  - Sculpt! Your! Tests!
Тарас Олексин - Sculpt! Your! Tests!
 
What's new in Android P @ I/O Extended Bangkok 2018
What's new in Android P @ I/O Extended Bangkok 2018What's new in Android P @ I/O Extended Bangkok 2018
What's new in Android P @ I/O Extended Bangkok 2018
 
Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)
 
Google analytics
Google analyticsGoogle analytics
Google analytics
 
Context and Dependency Injection
Context and Dependency InjectionContext and Dependency Injection
Context and Dependency Injection
 
Serverless Angular, Material, Firebase and Google Cloud applications
Serverless Angular, Material, Firebase and Google Cloud applicationsServerless Angular, Material, Firebase and Google Cloud applications
Serverless Angular, Material, Firebase and Google Cloud applications
 
Exploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptExploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScript
 
JSR 82 (bluetooth obex)
JSR 82 (bluetooth obex)JSR 82 (bluetooth obex)
JSR 82 (bluetooth obex)
 

Último

kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadhamedmustafa094
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsvanyagupta248
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxNadaHaitham1
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilVinayVitekari
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"mphochane1998
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersMairaAshraf6
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEselvakumar948
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesMayuraD1
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesRAJNEESHKUMAR341697
 

Último (20)

kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptx
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 

Eddystone beacons demo

  • 1. Eddystone Beacons Demo Lecture on Eddystone, an open Bluetooth Smart Beacon format from Google +Angelo Rüggeberg @s3xy4ngyc
  • 2. agenda - Introductions to Beacons - Introduction to Eddystone - Coding Session
  • 5. Location, Accuracy, Range, and alike Image: Google …
  • 9. Opportunities • Contextual fencing (aka Geo-fence) • Contextual content (e.g. reader circle) • … Image: Bundesarchiv
  • 10. Landscape • AltBeacon • Apple‘s property: iBeacon™ • Estimote • Gimbal™ • PayPal™ Beacon • yoints • … • Bluetooth® SIG (Special Interest Group) • Bluetooth® Smart Beacon • Eddystone™ • https://github. com/google/eddystone/tree/mast er/branding
  • 12. Eddystone™, what’s so special? Openness • It is an open Bluetooth 4.0 protocol • While iBeacon™ is officially supported by iOS devices only, Eddystone™ has official support for both iOS and Android Packet types / frames • Eddystone-UID (identifier) • Namespace as UUID • Instance (6 bytes), much like Major and Minor • Eddystone-URL • Eddystone-TLM (telemetry) • battery voltage • temperature • number of packets since last reboot • beacon uptime since last reboot
  • 13.
  • 14. Hardware Phones can become Smart Beacons themselves • TxEddystone-UID (Android Lollipop 5.0) Almost all devices with BLE can become Smart Beacons themselves • BlueGiga BLED112 Dongle • Cambridge Silicon Radio CSR1010 (Beacon Development Board) • Rfduino • Linux (bluez) • ARM mbed (Nordic nRF51-dongle, nRF51-DK) • Node.js (node-eddystone-beacon using bleno) • Arduino (BLEPeripheral), using Nordic Semiconductor's nRF8001 or nR51822 https://github. com/google/eddystone/tree/master/eddyst one-uid/tools/txeddystone-uid
  • 15. Some Bluetooth® Facts • Bluetooth / BLE is a wireless protocol • Bluetooth uses UHF radio waves in the ISM band from 2.4 to 2.485 GHz divided into channels with frequency hopping • Signal strength is an indicator for proximity (RSSI, received signal strength indicator) • BLE has reduced power consumption • Bluetooth SIG predicts more than 90% of Bluetooth-enabled smartphones will support the low energy standard by 2018.
  • 16.
  • 17.
  • 18. Coding a Simple BLE Scanner
  • 19. Prerequisites • Real device with BLE (emulator has no Bluetooth™ support) • Alternative emulator http: //stackoverflow. com/questions/20348743/blue tooth-low-energy-on-android- emulator/27712017 • Android 4.3 (Jelly Bean, API Level 18) • Android 4.4.4 (KitKat, API Level 19) fixes some issues (e.g. https://code.google. com/p/android/issues/detail? id=67272) • Android 5.0 (Lollipop, API Level 21) recommended due to some API changes (e.g. Advertisement and LE Scanner)
  • 20. BLE Permissions for an App • <!– Allow any Bluetooth communication --> <uses-permission android:name="android.permission.BLUETOOTH"/> <!– Allow device discovery --> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/> • <uses-feature android:name="android.hardware.bluetooth_le" android:required="true“ />
  • 22. public class MainActivity extends AppCompatActivity { // Declare Bluetooth adapter private BluetoothManager bluetoothManager; private BluetoothAdapter bluetoothAdapter;
  • 23. public class MainActivity extends AppCompatActivity { // Declare Bluetooth adapter private BluetoothManager bluetoothManager; private BluetoothAdapter bluetoothAdapter;
  • 24. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Initialize Bluetooth adapter bluetoothManager = (BluetoothManager) getSystemService(Context. BLUETOOTH_SERVICE); bluetoothAdapter = bluetoothManager.getAdapter(); …
  • 25. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Initialize Bluetooth adapter bluetoothManager = (BluetoothManager) getSystemService(Context. BLUETOOTH_SERVICE); bluetoothAdapter = bluetoothManager.getAdapter(); …
  • 26. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Initialize Bluetooth adapter bluetoothManager = (BluetoothManager) getSystemService(Context. BLUETOOTH_SERVICE); bluetoothAdapter = bluetoothManager.getAdapter(); …
  • 27. bluetoothAdapter.startLeScan(new BluetoothAdapter.LeScanCallback() { @Override public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) { Log.d(TAG, "Device-Adress: " + device.getAddress()); Log.d(TAG, "RSSI: " + rssi); } });
  • 28. bluetoothAdapter.startLeScan(new BluetoothAdapter.LeScanCallback() { @Override public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) { Log.d(TAG, "Device-Adress: " + device.getAddress()); Log.d(TAG, "RSSI: " + rssi); } });
  • 29. bluetoothAdapter.startLeScan(new BluetoothAdapter.LeScanCallback() { @Override public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) { Log.d(TAG, "Device-Adress: " + device.getAddress()); Log.d(TAG, "RSSI: " + rssi); } });
  • 30. bluetoothAdapter.startLeScan(new BluetoothAdapter.LeScanCallback() { @Override public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) { Log.d(TAG, "Device-Adress: " + device.getAddress()); Log.d(TAG, "RSSI: " + rssi); } });
  • 31. bluetoothAdapter.startLeScan(new BluetoothAdapter.LeScanCallback() { @Override public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) { if(device.getAddress().equals("C1:4F:F1:FF:9B:90")) { Log.d(TAG, "Device-Adress: " + device.getAddress()); Log.d(TAG, "RSSI: " + rssi); } } });
  • 32. bluetoothAdapter.startLeScan(new BluetoothAdapter.LeScanCallback() { @Override public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) { if(device.getAddress().equals("C1:4F:F1:FF:9B:90")) { Log.d(TAG, "Device-Adress: " + device.getAddress()); Log.d(TAG, "RSSI: " + rssi); } } });
  • 33. Move away from deprecated Methods
  • 34. bluetoothLeScanner = bluetoothAdapter.getBluetoothLeScanner(); bluetoothLeScanner.startScan(new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); } @Override public void onBatchScanResults(List<ScanResult> results) { super.onBatchScanResults(results); } });
  • 35. bluetoothLeScanner = bluetoothAdapter.getBluetoothLeScanner(); bluetoothLeScanner.startScan(new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); } @Override public void onBatchScanResults(List<ScanResult> results) { super.onBatchScanResults(results); } });
  • 36. bluetoothLeScanner = bluetoothAdapter.getBluetoothLeScanner(); bluetoothLeScanner.startScan(new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); } @Override public void onBatchScanResults(List<ScanResult> results) { super.onBatchScanResults(results); } });
  • 37. bluetoothLeScanner = bluetoothAdapter.getBluetoothLeScanner(); bluetoothLeScanner.startScan(new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); } @Override public void onBatchScanResults(List<ScanResult> results) { super.onBatchScanResults(results); } });
  • 38. bluetoothLeScanner.startScan(filters, settings, new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); } });
  • 39. bluetoothLeScanner.startScan(filters, settings, new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); } });
  • 40. ScanSettings settings = new ScanSettings.Builder() .setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY) .build(); List<ScanFilter> filters = new ArrayList<>(); ScanFilter filter = new ScanFilter.Builder() .setDeviceAddress("C1:4F:F1:FF:9B:90") .build(); filters.add(filter);
  • 41. ScanSettings settings = new ScanSettings.Builder() .setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY) .build(); List<ScanFilter> filters = new ArrayList<>(); ScanFilter filter = new ScanFilter.Builder() .setDeviceAddress("C1:4F:F1:FF:9B:90") .build(); filters.add(filter);
  • 42. ScanSettings settings = new ScanSettings.Builder() .setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY) .build(); List<ScanFilter> filters = new ArrayList<>(); ScanFilter filter = new ScanFilter.Builder() .setDeviceAddress("C1:4F:F1:FF:9B:90") .build(); filters.add(filter);
  • 43. ScanSettings settings = new ScanSettings.Builder() .setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY) .build(); List<ScanFilter> filters = new ArrayList<>(); ScanFilter filter = new ScanFilter.Builder() .setDeviceAddress("C1:4F:F1:FF:9B:90") .build(); filters.add(filter);
  • 44. ScanSettings settings = new ScanSettings.Builder() .setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY) .build(); List<ScanFilter> filters = new ArrayList<>(); ScanFilter filter = new ScanFilter.Builder() .setDeviceAddress("C1:4F:F1:FF:9B:90") .build(); filters.add(filter);
  • 45.
  • 47. There is only one packet format for BLE which
  • 48. Payload consists of 2 Bytes Header, 6 Bytes Mac Address and up to 31 Bytes data.
  • 50. Fixed: 02 01 06 03 03 aa fe Length: 15 Fixed: 16 aa fe Frame Type: 00 TX Power: ed Namespace: ed d1 eb ea c0 4e 5d ef a0 17 Instance: c5 61 2a 8c c2 53 ... 04 09 ... 45 53 54 03 03 Bat. Service: 0f 18 0e ... 16 0a 18 Mac: 53 c2 8c 2a 61 c5 ... 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  • 51. Fixed: 02 01 06 03 03 aa fe Length: 11 Fixed: 16 aa fe Frame Type: 20 Version: 00 Volt: 0c 06 Temo: 13 00 Adv. Count: 00 0f 70 77 Sec. Count: 00 14 4e 70 ... 04 09 ... 45 53 54 03 03 Bat. Service: 0f 18 0e ... 16 0a 18 Mac: 53 c2 8c 2a 61 c5 ... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  • 52. // The Eddystone Service UUID, 0xFEAA. private static final ParcelUuid EDDYSTONE_SERVICE_UUID = ParcelUuid.fromString("0000FEAA-0000-1000-8000- 00805F9B34FB"); // Eddystone frame types private static final byte TYPE_UID = 0x00; private static final byte TYPE_URL = 0x10; private static final byte TYPE_TLM = 0x20;
  • 53. // The Eddystone Service UUID, 0xFEAA. private static final ParcelUuid EDDYSTONE_SERVICE_UUID = ParcelUuid.fromString("0000FEAA-0000-1000-8000- 00805F9B34FB"); // Eddystone frame types private static final byte TYPE_UID = 0x00; private static final byte TYPE_URL = 0x10; private static final byte TYPE_TLM = 0x20;
  • 54. // The Eddystone Service UUID, 0xFEAA. private static final ParcelUuid EDDYSTONE_SERVICE_UUID = ParcelUuid.fromString("0000FEAA-0000-1000-8000- 00805F9B34FB"); // Eddystone frame types private static final byte TYPE_UID = 0x00; private static final byte TYPE_URL = 0x10; private static final byte TYPE_TLM = 0x20;
  • 55. // The Eddystone Service UUID, 0xFEAA. private static final ParcelUuid EDDYSTONE_SERVICE_UUID = ParcelUuid.fromString("0000FEAA-0000-1000-8000- 00805F9B34FB"); // Eddystone frame types private static final byte TYPE_UID = 0x00; private static final byte TYPE_URL = 0x10; private static final byte TYPE_TLM = 0x20;
  • 56. // The Eddystone Service UUID, 0xFEAA. private static final ParcelUuid EDDYSTONE_SERVICE_UUID = ParcelUuid.fromString("0000FEAA-0000-1000-8000- 00805F9B34FB"); // Eddystone frame types private static final byte TYPE_UID = 0x00; private static final byte TYPE_URL = 0x10; private static final byte TYPE_TLM = 0x20;
  • 58. bluetoothLeScanner.startScan(filters, settings, new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID); byte frameType = data[0]; if (frameType != TYPE_TLM) { return; } // Beacon temperature double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() / 256.0; Log.d(TAG, String.format("%.2f°C", temp)); } });
  • 59. bluetoothLeScanner.startScan(filters, settings, new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID); byte frameType = data[0]; if (frameType != TYPE_TLM) { return; } // Beacon temperature double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() / 256.0; Log.d(TAG, String.format("%.2f°C", temp)); } });
  • 60. bluetoothLeScanner.startScan(filters, settings, new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID); byte frameType = data[0]; if (frameType != TYPE_TLM) { return; } // Beacon temperature double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() / 256.0; Log.d(TAG, String.format("%.2f°C", temp)); } });
  • 61. bluetoothLeScanner.startScan(filters, settings, new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID); byte frameType = data[0]; if (frameType != TYPE_TLM) { return; } // Beacon temperature double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() / 256.0; Log.d(TAG, String.format("%.2f°C", temp)); } });
  • 62. Fixed: 02 01 06 03 03 aa fe Length: 11 Fixed: 16 aa fe Frame Type: 20 Version: 00 Volt: 0c 06 Temo: 13 00 Adv. Count: 00 0f 70 77 Sec. Count: 00 14 4e 70 ... 04 09 ... 45 53 54 03 03 Bat. Service: 0f 18 0e ... 16 0a 18 Mac: 53 c2 8c 2a 61 c5 ... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  • 63. bluetoothLeScanner.startScan(filters, settings, new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID); byte frameType = data[0]; if (frameType != TYPE_TLM) { return; } // Beacon temperature double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() / 256.0; Log.d(TAG, String.format("%.2f°C", temp)); } });
  • 64. bluetoothLeScanner.startScan(filters, settings, new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID); byte frameType = data[0]; if (frameType != TYPE_TLM) { return; } // Beacon temperature double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() / 256.0; Log.d(TAG, String.format("%.2f°C", temp)); } });
  • 65. bluetoothLeScanner.startScan(filters, settings, new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID); byte frameType = data[0]; if (frameType != TYPE_TLM) { return; } // Beacon temperature double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() / 256.0; Log.d(TAG, String.format("%.2f°C", temp)); } });