Android Open Source - BLE-Heart-rate-variability-demo Ble Device Info Service






From Project

Back to project page BLE-Heart-rate-variability-demo.

License

The source code is released under:

MIT License

If you think the Android project BLE-Heart-rate-variability-demo listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.sample.hrv.info;
//from w w  w .j  a va2s. com
import java.util.HashMap;

/**
 * Created by steven on 10/7/13.
 * Modified by olli on 3/28/2014.
 */
public class BleDeviceInfoService extends BleInfoService {

    private static final String UUID_SERVICE = "0000180a-0000-1000-8000-00805f9b34fb";

    private static final String UUID_SYSTEM_ID = "00002a23-0000-1000-8000-00805f9b34fb";
    private static final String UUID_MODEL_NUMBER = "00002a24-0000-1000-8000-00805f9b34fb";
    private static final String UUID_SERIAL_NUMBER = "00002a25-0000-1000-8000-00805f9b34fb";
    private static final String UUID_FIRMWARE_REV = "00002a26-0000-1000-8000-00805f9b34fb";
    private static final String UUID_HARDWARE_REV = "00002a27-0000-1000-8000-00805f9b34fb";
    private static final String UUID_SOFTWARE_REV = "00002a28-0000-1000-8000-00805f9b34fb";
    private static final String UUID_MANUFACTURER_NAME = "00002a29-0000-1000-8000-00805f9b34fb";
    private static final String UUID_CERT = "00002a2a-0000-1000-8000-00805f9b34fb";
    private static final String UUID_PNP_ID = "00002a50-0000-1000-8000-00805f9b34fb";


    private static final HashMap<String, String> CHARACTERISTIC_MAP = new HashMap<String, String>();

    static {
        CHARACTERISTIC_MAP.put(UUID_SYSTEM_ID, "System ID");
        CHARACTERISTIC_MAP.put(UUID_MODEL_NUMBER, "Model Number");
        CHARACTERISTIC_MAP.put(UUID_SERIAL_NUMBER, "Serial Number");
        CHARACTERISTIC_MAP.put(UUID_FIRMWARE_REV, "Firmware Revision");
        CHARACTERISTIC_MAP.put(UUID_HARDWARE_REV, "Hardware Revision");
        CHARACTERISTIC_MAP.put(UUID_SOFTWARE_REV, "Software Revision");
        CHARACTERISTIC_MAP.put(UUID_MANUFACTURER_NAME, "Manufacturer Name");
        CHARACTERISTIC_MAP.put(UUID_CERT, "IEEE 11073-20601 Regulatory Certification Data List\n");
        CHARACTERISTIC_MAP.put(UUID_PNP_ID, "PnP ID");
    }

    @Override
    public String getUUID() {
        return UUID_SERVICE;
    }

    @Override
    public String getName() {
        return "Device Information";
    }

    @Override
    public String getCharacteristicName(String uuid) {
        if (!CHARACTERISTIC_MAP.containsKey(uuid))
            return "Unknown";
        return CHARACTERISTIC_MAP.get(uuid);
    }
}




Java Source Code List

com.sample.hrv.BleService.java
com.sample.hrv.BluetoothGattExecutor.java
com.sample.hrv.DeviceScanActivity.java
com.sample.hrv.DeviceServicesActivity.java
com.sample.hrv.adapters.BleDevicesAdapter.java
com.sample.hrv.adapters.BleServicesAdapter.java
com.sample.hrv.demo.DemoGLSurfaceView.java
com.sample.hrv.demo.DemoHeartRateSensorActivity.java
com.sample.hrv.demo.DemoSensorActivity.java
com.sample.hrv.info.BleDeviceInfoService.java
com.sample.hrv.info.BleGapService.java
com.sample.hrv.info.BleGattService.java
com.sample.hrv.info.BleInfoService.java
com.sample.hrv.info.BleInfoServices.java
com.sample.hrv.sensor.BleHeartRateSensor.java
com.sample.hrv.sensor.BleSensorUtils.java
com.sample.hrv.sensor.BleSensor.java
com.sample.hrv.sensor.BleSensors.java
com.sample.hrv.sensor.BleTestSensor.java