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

Eddystone - Droidcon Paris 2015

Turhan OZ
November 10, 2015

Eddystone - Droidcon Paris 2015

Talk I gave during DroidconParis 2015

Turhan OZ

November 10, 2015
Tweet

More Decks by Turhan OZ

Other Decks in Technology

Transcript

  1. Droidcon Paris, 2015
    Eddystone™ an open Bluetooth® Smart
    beacon format from Google

    View Slide

  2. Who am I ?
    ❖ Turhan OZ
    ❖ turhanoz.com
    ❖ @TurhanOz
    ❖ @ParisAndroidUG

    View Slide

  3. Beacon - what’s that ?

    View Slide

  4. Beacon - what for ?

    View Slide

  5. Eddystone™
    ❖ an open BLE beacon format
    ❖ specification : github.com/google/eddystone

    View Slide

  6. Eddystone-UID
    Service UUID
    … OxO3 OxO3 0xFEAA
    Service Data
    … Ox16 OxFEAA 0x00 Tx Namespace ID (10 bytes) Instance ID (6 bytes)
    Beacon1 e83bda0408d0802c61b8 a000000000001
    Beacon2 e83bda0408d0802c61b8 a000000000002
    Beacon3 e83bda0408d0802c61b8 a000000000003
    ❖ Instance ID
    ❖ sha1 (droidcon.fr) = e83bda0408d0802c61b8a258a065d56bef3f43ac

    View Slide

  7. Eddystone-URL
    Service UUID
    … OxO3 OxO3 0xFEAA
    Service Data
    … Ox16 OxFEAA 0x10 Tx URL Scheme Encoded URL (up to 17 bytes)
    URL Scheme Prefix
    0x00 http://www.
    0x01 https://www.
    0x02 http://
    0x03 https://
    Url extension
    0x00 .com/
    0x01 .org/
    0x02 .edu/
    … …
    ❖ http://www.droidcon.com/paris
    http://www. d r o i d c o n .com/ p a r i s
    0x00 0x64 0x72 0x6F 0x69 0x64 0x63 0x6F 0x6E 0x00 0x70 0x61 0x72 0x69 0x73

    View Slide

  8. Walk up and use anything
    Physical Web http://physical-web.org

    View Slide

  9. Eddystone-TLM
    Service UUID
    … OxO3 OxO3 0xFEAA
    Service Data
    … Ox16 OxFEAA 0x20 Tx Battery Voltage Temp Count
    Time since
    power

    View Slide

  10. Eddystone Scanning
    BluetoothManager manager = (BluetoothManager) getSystemService(BLUETOOTH_SERVICE);
    BluetoothLeScanner scanner = manager.getAdapter().getBluetoothLeScanner();
    scanner.startScan(filters, settings, scanCallback);
    //Eddystone service UUID
    private static final ParcelUuid UID_SERVICE =
    ParcelUuid.fromString("0000feaa-0000-1000-8000-00805f9b34fb");
    ScanFilter beaconFilter = new ScanFilter.Builder()
    .setServiceUuid(UID_SERVICE)
    .setServiceData(UID_SERVICE, FRAME_FILTER_ON_URL, FILTER_MASK_ON_FRAME_TYPE)
    .build();
    List filters = Collections.singletonList(beaconFilter);
    public static final byte[] FRAME_FILTER_ON_URL = { /* 0x100000000000000000000000000000000000 */ };
    public static final byte[] FILTER_MASK_ON_FRAME_TYPE = { /* 0xFF0000000000000000000000000000000000 */ };
    Service UUID
    … OxO3 OxO3 0xFEAA
    Service Data
    … Ox16 OxFEAA 0x10 Tx URL Scheme Encoded URL (up to 17 bytes)

    View Slide

  11. Eddystone Scanning
    BluetoothManager manager = (BluetoothManager) getSystemService(BLUETOOTH_SERVICE);
    BluetoothLeScanner scanner = manager.getAdapter().getBluetoothLeScanner();
    scanner.startScan(filters, settings, scanCallback);
    private ScanCallback scanCallback = new ScanCallback() {
    @Override
    public void onScanResult(int callbackType, ScanResult result) {
    byte[] serviceDate = result.getScanRecord().getServiceData(UID_SERVICE);
    }
    @Override
    public void onBatchScanResults(List results) {}
    @Override
    public void onScanFailed(int errorCode) {}
    };

    View Slide

  12. Beacon Platform
    Web Management
    Platform ??

    View Slide

  13. Proximity Beacon REST Api
    beacons
    beaconinfo
    namespaces
    diagnotics
    attachments
    getforobserved
    create
    list
    delete
    batchDelete
    list list
    get
    list
    update
    register
    decommission
    activate
    deactivate
    https://developers.google.com/beacons/proximity/reference/rest/ https://github.com/TurhanOz/RxProximityBeacon

    View Slide

  14. beacons.get

    View Slide

  15. attachments.list

    View Slide

  16. Nearby Messages API

    View Slide

  17. Sum-up
    ❖ beacon: hardware that advertises data
    ❖ Eddystone™: open Bluetooth® beacon format from Google
    ❖ UID
    ❖ URL (Physical Web)
    ❖ TLM
    ❖ Beacon Platform: Enhance (attachments, location) and Monitor
    ❖ Proximity Beacon REST API
    ❖ Client Side
    ❖ Nearby Messages API, Places API (& Proximity Beacon API)

    View Slide

  18. @TurhanOz
    https://developers.google.com/beacons/overview
    https://github.com/google/eddystone/
    https://github.com/TurhanOz/RxProximityBeacon
    http://physical-web.org
    Thank You

    View Slide