Android Open Source - BleSensorTag Ti Sensors

From Project

Back to project page BleSensorTag.


The source code is released under:

MIT License

If you think the Android project BleSensorTag 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 sample.ble.sensortag.sensor;
//  ww w .j a v  a  2 s  .  com
import java.util.HashMap;

 * Created by steven on 9/4/13.
public class TiSensors {

    private static HashMap<String, TiSensor<?>> SENSORS = new HashMap<String, TiSensor<?>>();

    static {
        final TiAccelerometerSensor accelerometerSensor = new TiAccelerometerSensor();
        final TiGyroscopeSensor gyroscopeSensor = new TiGyroscopeSensor();
        final TiHumiditySensor humiditySensor = new TiHumiditySensor();
        final TiKeysSensor keysSensor = new TiKeysSensor();
        final TiMagnetometerSensor magnetometerSensor = new TiMagnetometerSensor();
        final TiPressureSensor pressureSensor = new TiPressureSensor();
        final TiTemperatureSensor temperatureSensor = new TiTemperatureSensor();
        final TiTestSensor testSensor = new TiTestSensor();

        SENSORS.put(accelerometerSensor.getServiceUUID(), accelerometerSensor);
        SENSORS.put(gyroscopeSensor.getServiceUUID(), gyroscopeSensor);
        SENSORS.put(humiditySensor.getServiceUUID(), humiditySensor);
        SENSORS.put(keysSensor.getServiceUUID(), keysSensor);
        SENSORS.put(magnetometerSensor.getServiceUUID(), magnetometerSensor);
        SENSORS.put(pressureSensor.getServiceUUID(), pressureSensor);
        SENSORS.put(temperatureSensor.getServiceUUID(), temperatureSensor);
        SENSORS.put(testSensor.getServiceUUID(), testSensor);

    public static TiSensor<?> getSensor(String uuid) {
        return SENSORS.get(uuid);

Java Source Code List