From b3399fa539ff424a8179a50c3bbc0eed3e6faf10 Mon Sep 17 00:00:00 2001 From: Alexandros Schillings Date: Tue, 11 Mar 2014 20:45:18 +0000 Subject: [PATCH] Added some javadoc --- .../device/BluetoothLeDevice.java | 7 +++ .../mfdata/IBeaconManufacturerData.java | 61 +++++++++++-------- 2 files changed, 42 insertions(+), 26 deletions(-) diff --git a/library/src/uk/co/alt236/bluetoothlelib/device/BluetoothLeDevice.java b/library/src/uk/co/alt236/bluetoothlelib/device/BluetoothLeDevice.java index c28e71b..34fad65 100644 --- a/library/src/uk/co/alt236/bluetoothlelib/device/BluetoothLeDevice.java +++ b/library/src/uk/co/alt236/bluetoothlelib/device/BluetoothLeDevice.java @@ -11,6 +11,13 @@ import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; +/* + * This is a wrapper around the default BluetoothDevice object + * As BluetoothDevice is final it cannot be extended, so to get it you + * need to call {@link #getDevice()} method. + * + * @author Alexandros Schillings + */ public class BluetoothLeDevice implements Parcelable{ private static final String PARCEL_EXTRA_BLUETOOTH_DEVICE = "bluetooth_device"; private static final String PARCEL_EXTRA_DEVICE_RSSI = "device_rssi"; diff --git a/library/src/uk/co/alt236/bluetoothlelib/device/mfdata/IBeaconManufacturerData.java b/library/src/uk/co/alt236/bluetoothlelib/device/mfdata/IBeaconManufacturerData.java index 443b356..5a47783 100644 --- a/library/src/uk/co/alt236/bluetoothlelib/device/mfdata/IBeaconManufacturerData.java +++ b/library/src/uk/co/alt236/bluetoothlelib/device/mfdata/IBeaconManufacturerData.java @@ -8,33 +8,42 @@ import uk.co.alt236.bluetoothlelib.device.adrecord.AdRecord; import uk.co.alt236.bluetoothlelib.util.ByteUtils; import android.util.Log; -public final class IBeaconManufacturerData { - // 0 4C # Byte 1 (LSB) of Company identifier code - // 1 00 # Byte 0 (MSB) of Company identifier code (0x004C == Apple) - // 2 02 # Byte 0 of iBeacon advertisement indicator - // 3 15 # Byte 1 of iBeacon advertisement indicator - // 4 e2 |\ - // 5 c5 |\\ - // 6 6d |#\\ - // 7 b5 |##\\ - // 8 df |###\\ - // 9 fb |####\\ - // 10 48 |#####\\ - // 11 d2 |#####|| iBeacon proximity UUID - // 12 b0 |#####|| - // 13 60 |#####// - // 14 d0 |####// - // 15 f5 |###// - // 16 a7 |##// - // 17 10 |#// - // 18 96 |// - // 19 e0 |/ - // 20 00 # major - // 21 00 - // 22 00 # minor - // 23 00 - // 24 c5 # The 2's complement of the calibrated Tx Power +/** + * Objectifies the Manufactured Data field of an iBeacon + * + * The parsing is based on the following schema: + * + * 0 4C - Byte 1 (LSB) of Company identifier code + * 1 00 - Byte 0 (MSB) of Company identifier code (0x004C == Apple) + * 2 02 - Byte 0 of iBeacon advertisement indicator + * 3 15 - Byte 1 of iBeacon advertisement indicator + * 4 e2 |\ + * 5 c5 |\\ + * 6 6d |#\\ + * 7 b5 |##\\ + * 8 df |###\\ + * 9 fb |####\\ + * 10 48 |#####\\ + * 11 d2 |#####|| iBeacon proximity UUID + * 12 b0 |#####|| + * 13 60 |#####// + * 14 d0 |####// + * 15 f5 |###// + * 16 a7 |##// + * 17 10 |#// + * 18 96 |// + * 19 e0 |/ + * 20 00 - major + * 21 00 + * 22 00 - minor + * 23 00 + * 24 c5 - The 2's complement of the calibrated Tx Power + * + * @author Alexandros Schillings + * + */ +public final class IBeaconManufacturerData { private final byte[] mData; private final int mCalibratedTxPower; private final int mCompanyIdentidier;