The Android Open Source Project | d6054a3 | 2008-10-21 07:00:00 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2008, The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include <hardware/sensors.h> |
| 18 | #include <unistd.h> |
| 19 | |
| 20 | |
| 21 | uint32_t sensors_control_init() { |
| 22 | return 0; |
| 23 | } |
| 24 | |
| 25 | /* returns a fd where to read the events from. the caller takes |
| 26 | * ownership of this fd */ |
| 27 | int sensors_control_open() { |
| 28 | return -1; |
| 29 | } |
| 30 | |
| 31 | /* returns a bitmask indicating which sensors are enabled */ |
| 32 | uint32_t sensors_control_activate(uint32_t sensors, uint32_t mask) { |
| 33 | return 0; |
| 34 | } |
| 35 | |
| 36 | /* set the delay between sensor events in ms */ |
| 37 | int sensors_control_delay(int32_t ms) { |
| 38 | return -1; |
| 39 | } |
| 40 | |
| 41 | /* initialize the sensor data read. doesn't take ownership of the fd */ |
| 42 | int sensors_data_open(int fd) { |
| 43 | return 0; |
| 44 | } |
| 45 | |
| 46 | /* done with sensor data */ |
| 47 | int sensors_data_close() { |
| 48 | return -1; |
| 49 | } |
| 50 | |
| 51 | /* returns a bitmask indicating which sensors have changed */ |
| 52 | int sensors_data_poll(sensors_data_t* data, uint32_t sensors_of_interest) { |
| 53 | usleep(60000000); |
| 54 | return 0; |
| 55 | } |
| 56 | |
| 57 | /* returns available sensors */ |
| 58 | uint32_t sensors_data_get_sensors() { |
| 59 | return 0; |
| 60 | } |