2 * Copyright (c) 2012 Simon Busch <morphis@gravedo.de>
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 #include <android/hardware/sensors.h>
23 int main(int argc
, char **argv
)
25 struct hw_module_t
*hwmod
;
26 struct sensors_poll_device_t
*dev
;
28 hw_get_module(SENSORS_HARDWARE_MODULE_ID
, (const hw_module_t
**) &hwmod
);
29 assert(hwmod
!= NULL
);
31 if (sensors_open(hwmod
, &dev
) < 0) {
32 printf("ERROR: failed to open sensors device\n");
36 if (sensors_close(dev
) < 0) {
37 printf("ERROR: failed to close sensors device\n");
44 // vim:ts=4:sw=4:noexpandtab