android中Sensor工作流程(6)

来源:未知 责任编辑:责任编辑 发表时间:2014-01-26 21:59 点击:

      /**
       * Set the delay between sensor events in ms
       *
       * @return 0 if successful, < 0 on error
       */
     int (*set_delay)(struct sensors_control_device_t *dev, int32_t ms);
     /**
       * Causes sensors_data_device_t.poll() to return -EWOULDBLOCK immediately.
       */
     int (*wake)(struct sensors_control_device_t *dev);
};
struct sensors_data_device_t {
     struct hw_device_t common;
     /**
       * Prepare to read sensor data.
       *
       * This routine does NOT take ownership of the fd
       * and must not close it. Typically this routine would
       * use a duplicate of the fd parameter.
       *
       * @param fd from sensors_control_open.
       *
       * @return 0 if successful, < 0 on error
       */
     int (*data_open)(struct sensors_data_device_t *dev, int fd);
     /**
       * Caller has completed using the sensor data.
       * The caller will not be blocked in sensors_data_poll
       * when this routine is called.
       *
       * @return 0 if successful, < 0 on error
       */
     int (*data_close)(struct sensors_data_device_t *dev);
     /**
       * Return sensor data for one of the enabled sensors.
       *
       * @return sensor handle for the returned data, 0x7FFFFFFF when
       * sensors_control_device_t.wake() is called and -errno on error
       *
        */
      int (*poll)(struct sensors_data_device_t *dev,
                 sensors_data_t* data);
};
最后一组函数
/** convenience API for opening and closing a device */
static inline int sensors_control_open(const struct hw_module_t* module,
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
用户名: 验证码:点击我更换图片
最新评论 更多>>

推荐热点

  • Android 完全退出程序
  • 原创:Android应用开发-Andorid歌词秀,含源码
  • android 屏幕保护
  • Android手机软件汉化教程---第四课 dex文件汉化
  • 众多Android 开源项目推荐,给力工作给力学习
  • Android Audio代码分析4
  • Android得到已安装的应用程序信息!
  • Android开发者指南(29) —— USB Host and Accessory
  • Android成长的幕后推手:工程师鲁宾
网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
Copyright © 2008-2015 计算机技术学习交流网. 版权所有

豫ICP备11007008号-1