Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Eddystone

romemore
November 06, 2015

 Eddystone

romemore

November 06, 2015
Tweet

More Decks by romemore

Other Decks in Technology

Transcript

  1. BLUETOOTH LOW ENERGY POWER 1 year on a AA battery

    (basic usage with ID) DISTANCE 30 to 50m (configurable, up to 150m) AVAILABLE on many mobile devices
  2. EDDYSTONE UID 0 1 2 3 4 5 6 7

    8 9 10 11 12 13 14 15 16 17 18 19 0x00 0xee 0xd1 0x06 0x78 0x27 0xa8 0xfa 0x7c 0x08 0x68 0xd3 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x00 NAMESPACE ID (10 BYTES) D1 06 78 27 A8 FA 7C 08 68 D3 FRAME TYPE 0X00 = UID TX POWER 0XEE = -18DB INSTANCE ID (6 BYTES) 00 00 00 00 00 01 RFU
  3. EDDYSTONE UID : TRUNCATED HASH OF FQDN DEVFEST.GDGNANTES.COM C0 5E

    EB 31 E9 F6 0D 46 E8 9E F3 FB 2F 5C 0B BE FB AD 79 A4 C0 5E EB 31 E9 F6 0D 46 E8 9E sha1() take(10) 00 00 00 00 00 01 00 00 00 00 00 02 00 00 00 00 00 03
  4. EDDYSTONE UID : ELIDED VERSION 4 UUID 77336605-50DF-4104-9914-F217EFAFBD47 77 33

    66 05 F2 17 EF AF BD 47 77336605-50DF-4104-9914-F217EFAFBD47
  5. EDDYSTONE UID SCANNER // Eddystone service uuid (0xfeaa)
 private static

    final ParcelUuid UID_SERVICE = 
 ParcelUuid.fromString("0000feaa-0000-1000-8000-00805f9b34fb");
 
 // Namespace id for Devfest Eddystone beacons (devfest.gdgnantes.com / c05eeb31e9f60d46e89e)
 private static final byte[] NAMESPACE_FILTER = {
 0x00, //Frame type = UID
 0x00, //TX power, we don't care the value for filter
 (byte)0xc0, (byte)0x5e, (byte)0xeb, (byte)0x31, (byte)0xe9,
 (byte)0xf6, (byte)0x0d, (byte)0x46, (byte)0xe8, (byte)0x9e,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
 
 // Force frame type and namespace id to match
 private static final byte[] NAMESPACE_FILTER_MASK = {
 (byte)0xFF,
 0x00,
 (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF,
 (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
  6. EDDYSTONE UID SCANNER // Eddystone service uuid (0xfeaa)
 private static

    final ParcelUuid UID_SERVICE = 
 ParcelUuid.fromString("0000feaa-0000-1000-8000-00805f9b34fb");
 
 // Namespace id for Devfest Eddystone beacons (devfest.gdgnantes.com / c05eeb31e9f60d46e89e)
 private static final byte[] NAMESPACE_FILTER = {
 0x00, //Frame type = UID
 0x00, //TX power, we don't care the value for filter
 (byte)0xc0, (byte)0x5e, (byte)0xeb, (byte)0x31, (byte)0xe9,
 (byte)0xf6, (byte)0x0d, (byte)0x46, (byte)0xe8, (byte)0x9e,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
 
 // Force frame type and namespace id to match
 private static final byte[] NAMESPACE_FILTER_MASK = {
 (byte)0xFF,
 0x00,
 (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF,
 (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
  7. EDDYSTONE UID SCANNER // Eddystone service uuid (0xfeaa)
 private static

    final ParcelUuid UID_SERVICE = 
 ParcelUuid.fromString("0000feaa-0000-1000-8000-00805f9b34fb");
 
 // Namespace id for Devfest Eddystone beacons (devfest.gdgnantes.com / c05eeb31e9f60d46e89e)
 private static final byte[] NAMESPACE_FILTER = {
 0x00, //Frame type = UID
 0x00, //TX power, we don't care the value for filter
 (byte)0xc0, (byte)0x5e, (byte)0xeb, (byte)0x31, (byte)0xe9,
 (byte)0xf6, (byte)0x0d, (byte)0x46, (byte)0xe8, (byte)0x9e,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
 
 // Force frame type and namespace id to match
 private static final byte[] NAMESPACE_FILTER_MASK = {
 (byte)0xFF,
 0x00,
 (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF,
 (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
  8. EDDYSTONE UID SCANNER BluetoothManager manager = (BluetoothManager) getSystemService(BLUETOOTH_SERVICE);
 mBluetoothLeScanner =

    manager.getAdapter().getBluetoothLeScanner(); ScanFilter beaconFilter = new ScanFilter.Builder()
 .setServiceUuid(UID_SERVICE)
 .setServiceData(UID_SERVICE, NAMESPACE_FILTER, NAMESPACE_FILTER_MASK)
 .build();
 
 List<ScanFilter> filters = new ArrayList<>();
 filters.add(beaconFilter);
 
 ScanSettings settings = new ScanSettings.Builder()
 .setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
 .build();
 
 mBluetoothLeScanner.startScan(filters, settings, mScanCallback);
  9. EDDYSTONE URL 0 1 2 3 4 5 6 7

    8 9 10 11 12 13 14 15 16 17 18 19 0x10 0xee 0x03 0x67 0x6f 0x6f 0x2e 0x67 0x2f 0x39 0x74 0x42 0x75 0x36 0x6c 0x00 0x00 0x00 0x00 0x00 HTTPS://GOO.GL/9TBU6I 67 6F 6F 2E 67 6C 2F 39 74 42 75 36 6C FRAME TYPE 0X10 = URL TX POWER 0XEE = -18DB URL SCHEME 0X03 = HTTPS://
  10. EDDYSTONE TLM 0 1 2 3 4 5 6 7

    8 9 10 11 12 13 14 15 16 17 18 19 0x20 0x00 0x00 0x67 0x80 0x00 0x00 0x00 0x00 0x39 0x00 0x00 0x00 0x36 0x00 0x00 0x00 0x00 0x00 0x00 FRAME TYPE 0X20 = TLM TLM VERSION 0X00 = FIRST BATTERY VOLTAGE BEACON TEMPERATURE ADVERTISING PDU COUNT TIME SINCE POWER-ON OR REBOOT
  11. associate blob of data monitor the health of your beacons

    works with Eddystone + iBeacon PROXIMITY BEACON API
  12. PROXIMITY BEACON API 16 bytes UID status (active/inactive) stability (stable/moving)

    latitude longitude REGISTER Indoor floor level Google Places ID Description Arbitrary properties
  13. PROXIMITY BEACON API MONITOR Predicted battery death Beacons moved away

    from their location Unusually low detection rates
  14. MessageListener messageListener = new MessageListener() {
 @Override
 public void onFound(Message

    message) {
 String nearbyMessageNamespace = message.getNamespace();
 String nearbyMessageType = message.getType();
 String nearbyMessageString = new String(message.getContent());
 
 Log.i(TAG, "Message string: " + nearbyMessageString);
 Log.i(TAG, "Message namespaced type: " + nearbyMessageNamespace +
 "/" + nearbyMessageType);
 }
 };
 
 // Use Strategy.BLE_ONLY because we are only interested in messages that we
 // attached to BLE beacons.
 Nearby.Messages.subscribe(client, messageListener, Strategy.BLE_ONLY)
 .setResultCallback(new ErrorCheckingCallback("subscribe()")); NEARBY MESSAGES API
  15. IOT/IOE READY ? micro/indoor location attachments UID TLM URL telemetry

    inventory hello physical web web interaction … your idea !