• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java UserDriverManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.android.things.userdriver.UserDriverManager的典型用法代码示例。如果您正苦于以下问题:Java UserDriverManager类的具体用法?Java UserDriverManager怎么用?Java UserDriverManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



UserDriverManager类属于com.google.android.things.userdriver包,在下文中一共展示了UserDriverManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: registerDriver

import com.google.android.things.userdriver.UserDriverManager; //导入依赖的package包/类
public void registerDriver() {
    if (mLm75 == null)
        throw new IllegalStateException(TAG + ": LM75 sensor isn't available!");

    if (mUserSensor == null) {
        mUserSensor = UserSensor.builder()
                .setType(Sensor.TYPE_AMBIENT_TEMPERATURE)
                .setName(DRIVER_NAME)
                .setVendor(DRIVER_VENDOR)
                .setVersion(DRIVER_VERSION)
                //.setMaxRange(DRIVER_MAX_RANGE)
                //.setResolution(DRIVER_RESOLUTION)
                //.setPower(DRIVER_POWER)
                .setMinDelay(DRIVER_MIN_DELAY)
                .setMaxDelay(DRIVER_MAX_DELAY)
                .setRequiredPermission(DRIVER_REQUIRED_PERMISSION)
                .setUuid(UUID.randomUUID())
                .setDriver(this)
                .build();
        UserDriverManager.getManager().registerSensor(mUserSensor);
    }
}
 
开发者ID:m-thu,项目名称:android-things,代码行数:23,代码来源:Lm75Driver.java


示例2: registerParticleSensor

import com.google.android.things.userdriver.UserDriverManager; //导入依赖的package包/类
/**
 * Register a {@link UserSensor} that pipes particle count readings into the
 * Android SensorManager.
 * @see #unregisterParticleSensor()
 */
public void registerParticleSensor() {
    if (mDevice == null) {
        throw new IllegalStateException("cannot register closed driver");
    }

    if (mUserDriver == null) {
        mUserDriver = new ParticleCountUserDriver();
        UserDriverManager.getManager().registerSensor(mUserDriver.getUserSensor());
    }
}
 
开发者ID:jpuderer,项目名称:Taxi-Datalogger,代码行数:16,代码来源:HpmSensorDriver.java


示例3: unregisterParticleSensor

import com.google.android.things.userdriver.UserDriverManager; //导入依赖的package包/类
/**
 * Unregister the particle sensor {@link UserSensor}.
 */
public void unregisterParticleSensor() {
    if (mUserDriver != null) {
        UserDriverManager.getManager().unregisterSensor(mUserDriver.getUserSensor());
        mUserDriver = null;
    }
}
 
开发者ID:jpuderer,项目名称:Taxi-Datalogger,代码行数:10,代码来源:HpmSensorDriver.java


示例4: unregisterSensor

import com.google.android.things.userdriver.UserDriverManager; //导入依赖的package包/类
public void unregisterSensor() throws IOException {
    if (mDistanceUserDriver != null) {
        UserDriverManager.getManager().unregisterSensor(mDistanceUserDriver.getUserSensor());
        mDistanceUserDriver.close();
        mDistanceUserDriver = null;
    }
}
 
开发者ID:holgi-s,项目名称:RangeThings,代码行数:8,代码来源:HCSR04Driver.java


示例5: register

import com.google.android.things.userdriver.UserDriverManager; //导入依赖的package包/类
/**
 * Register this driver with the Android input framework.
 */
public void register() {
    if (inputDriver == null) {
        UserDriverManager manager = UserDriverManager.getManager();
        inputDriver = new InputDriver.Builder(InputDevice.SOURCE_CLASS_BUTTON)
                .setName(DRIVER_NAME)
                .setVersion(DRIVER_VERSION)
                .setKeys(keycodes)
                .build();
        manager.registerInputDriver(inputDriver);
    }
}
 
开发者ID:Nilhcem,项目名称:mpr121-androidthings,代码行数:15,代码来源:Mpr121InputDriver.java


示例6: unregister

import com.google.android.things.userdriver.UserDriverManager; //导入依赖的package包/类
/**
 * Unregister this driver with the Android input framework.
 */
public void unregister() {
    if (inputDriver != null) {
        UserDriverManager manager = UserDriverManager.getManager();
        manager.unregisterInputDriver(inputDriver);
        inputDriver = null;
    }
}
 
开发者ID:Nilhcem,项目名称:mpr121-androidthings,代码行数:11,代码来源:Mpr121InputDriver.java


示例7: register

import com.google.android.things.userdriver.UserDriverManager; //导入依赖的package包/类
/**
 * Register the driver in the framework.
 * @see #unregister()
 */
public void register() {
    if (lsm9DS0 == null) {
        throw new IllegalStateException("cannot registered closed driver");
    }
    if (userSensor == null) {
        userSensor = build(lsm9DS0);
        UserDriverManager.getManager().registerSensor(userSensor);
    }
}
 
开发者ID:hongcheng79,项目名称:androidthings,代码行数:14,代码来源:LSM9DS0Driver.java


示例8: unregister

import com.google.android.things.userdriver.UserDriverManager; //导入依赖的package包/类
/**
 * Unregister the driver from the framework.
 */
public void unregister() {
    if  ( userSensor != null ) {
        UserDriverManager.getManager().unregisterSensor(userSensor);
        userSensor = null;
    }
}
 
开发者ID:hongcheng79,项目名称:androidthings,代码行数:10,代码来源:LSM9DS0Driver.java


示例9: registerMagmetormeterSensor

import com.google.android.things.userdriver.UserDriverManager; //导入依赖的package包/类
void registerMagmetormeterSensor() {
    if (hmcl5883l == null) {
        throw new IllegalStateException("cannot register closed driver");
    }

    if (mUserDriver == null) {
        mUserDriver = new MagnetometerUserDriver();
        UserDriverManager.getManager().registerSensor(mUserDriver.getUserSensor());
    }
}
 
开发者ID:kevalpatel2106,项目名称:robo-car,代码行数:11,代码来源:HMC5883LSensorDriver.java


示例10: registerTemperatureSensor

import com.google.android.things.userdriver.UserDriverManager; //导入依赖的package包/类
/**
 * Register a {@link UserSensor} that pipes temperature readings into the Android SensorManager.
 * @see #unregisterTemperatureSensor()
 */
public void registerTemperatureSensor() {
    if (mDevice == null) {
        throw new IllegalStateException("cannot register closed driver");
    }

    if (mTemperatureUserDriver == null) {
        mTemperatureUserDriver = new TemperatureUserDriver();
        UserDriverManager.getManager().registerSensor(mTemperatureUserDriver.getUserSensor());
    }
}
 
开发者ID:jpuderer,项目名称:jpuderer-things-drivers,代码行数:15,代码来源:Sht1xSensorDriver.java


示例11: registerHumiditySensor

import com.google.android.things.userdriver.UserDriverManager; //导入依赖的package包/类
/**
 * Register a {@link UserSensor} that pipes humidity readings into the Android SensorManager.
 * @see #unregisterHumiditySensor()
 */
public void registerHumiditySensor() {
    if (mDevice == null) {
        throw new IllegalStateException("cannot register closed driver");
    }

    if (mHumidityUserDriver == null) {
        mHumidityUserDriver = new HumidityUserDriver();
        UserDriverManager.getManager().registerSensor(mHumidityUserDriver.getUserSensor());
    }
}
 
开发者ID:jpuderer,项目名称:jpuderer-things-drivers,代码行数:15,代码来源:Sht1xSensorDriver.java


示例12: unregisterTemperatureSensor

import com.google.android.things.userdriver.UserDriverManager; //导入依赖的package包/类
/**
 * Unregister the temperature {@link UserSensor}.
 */
public void unregisterTemperatureSensor() {
    if (mTemperatureUserDriver != null) {
        UserDriverManager.getManager().unregisterSensor(mTemperatureUserDriver.getUserSensor());
        mTemperatureUserDriver = null;
    }
}
 
开发者ID:jpuderer,项目名称:jpuderer-things-drivers,代码行数:10,代码来源:Sht1xSensorDriver.java


示例13: unregisterHumiditySensor

import com.google.android.things.userdriver.UserDriverManager; //导入依赖的package包/类
/**
 * Unregister the humidity {@link UserSensor}.
 */
public void unregisterHumiditySensor() {
    if (mHumidityUserDriver != null) {
        UserDriverManager.getManager().unregisterSensor(mHumidityUserDriver.getUserSensor());
        mHumidityUserDriver = null;
    }
}
 
开发者ID:jpuderer,项目名称:jpuderer-things-drivers,代码行数:10,代码来源:Sht1xSensorDriver.java


示例14: register

import com.google.android.things.userdriver.UserDriverManager; //导入依赖的package包/类
public void register() {
    if (device == null) {
        throw new IllegalStateException("cannot registered closed driver");
    }
    if (userSensor == null) {
        userSensor = build(device);
        UserDriverManager.getManager().registerSensor(userSensor);
    }
}
 
开发者ID:vishal-android-freak,项目名称:HC-SR04-AndroidThings-Library,代码行数:10,代码来源:Hcsr04UltrasonicDriver.java


示例15: registerAccelerometerSensor

import com.google.android.things.userdriver.UserDriverManager; //导入依赖的package包/类
public void registerAccelerometerSensor() {
    if (adxl345 == null) {
        throw new IllegalStateException("cannot register closed driver");
    }

    if (mUserDriver == null) {
        mUserDriver = new AccelerometerUserDriver();
        UserDriverManager.getManager().registerSensor(mUserDriver.getUserSensor());
    }
}
 
开发者ID:cagdasc,项目名称:AndroidThings-ADXL345,代码行数:11,代码来源:ADXL345SensorDriver.java


示例16: registerMagmetormeterSensor

import com.google.android.things.userdriver.UserDriverManager; //导入依赖的package包/类
public void registerMagmetormeterSensor() {
    if (hmcl5883l == null) {
        throw new IllegalStateException("cannot register closed driver");
    }

    if (mUserDriver == null) {
        mUserDriver = new MagnetometerUserDriver();
        UserDriverManager.getManager().registerSensor(mUserDriver.getUserSensor());
    }
}
 
开发者ID:cagdasc,项目名称:AndroidThings-HMC5883L,代码行数:11,代码来源:HMC5883LSensorDriver.java


示例17: register

import com.google.android.things.userdriver.UserDriverManager; //导入依赖的package包/类
/**
 * Register the driver in the framework.
 * @see #unregister()
 */
public void register() {
    if (mDevice == null) {
        throw new IllegalStateException("cannot registered closed driver");
    }
    if (mUserSensor == null) {
        mUserSensor = build(mDevice);
        UserDriverManager.getManager().registerSensor(mUserSensor);
    }
}
 
开发者ID:vishal-android-freak,项目名称:ADXL362-Interfacing-Library,代码行数:14,代码来源:Adxl362AccelerometerDriver.java


示例18: unregister

import com.google.android.things.userdriver.UserDriverManager; //导入依赖的package包/类
/**
 * Unregister the driver from the framework.
 */
public void unregister() {
    if (mUserSensor != null) {
        UserDriverManager.getManager().unregisterSensor(mUserSensor);
        mUserSensor = null;
    }
}
 
开发者ID:vishal-android-freak,项目名称:ADXL362-Interfacing-Library,代码行数:10,代码来源:Adxl362AccelerometerDriver.java


示例19: registerProximitySensor

import com.google.android.things.userdriver.UserDriverManager; //导入依赖的package包/类
/**
 * Register a {@link UserSensor} that pipes temperature readings into the Android SensorManager.
 * @see #unregisterProximitySensor()
 */
public void registerProximitySensor() {
    if (mDevice == null) {
        throw new IllegalStateException("cannot register closed driver");
    }

    if (mProximityUserDriver == null) {
        mProximityUserDriver = new ProximityUserDriver();
        UserDriverManager.getManager().registerSensor(mProximityUserDriver.getUserSensor());
    }
}
 
开发者ID:androidthings,项目名称:contrib-drivers,代码行数:15,代码来源:Vcnl4200SensorDriver.java


示例20: unregisterProximitySensor

import com.google.android.things.userdriver.UserDriverManager; //导入依赖的package包/类
/**
 * Unregister the proximity {@link UserSensor}.
 */
public void unregisterProximitySensor() {
    if (mProximityUserDriver != null) {
        UserDriverManager.getManager().unregisterSensor(mProximityUserDriver.getUserSensor());
        mProximityUserDriver = null;
    }
}
 
开发者ID:androidthings,项目名称:contrib-drivers,代码行数:10,代码来源:Vcnl4200SensorDriver.java



注:本文中的com.google.android.things.userdriver.UserDriverManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Condition类代码示例发布时间:2022-05-22
下一篇:
Java LinkedElement类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap