1 /* Medfield sensor plugins
2 * Copyright (C) 2013 Intel Corporation
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; version 2.1.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301USA
18 #include "lightprocessor.h"
19 #include "compassprocessor.h"
20 #include "proxiprocessor.h"
21 #include "accelprocessor.h"
22 #include "gyroprocessor.h"
23 #include "ms5607processors.h"
30 int main(int argc, char **argv)
32 BaseProcessor *processor = 0;
36 string name = argv[1];
37 if (name == "compass") {
38 processor = new CompassProcessor();
39 event = GEOMAGNETIC_RAW_DATA_SET;
40 } else if (name == "light") {
41 processor = new LightProcessor();
42 event = LIGHT_BASE_DATA_SET;
45 else if (name == "proxi") {
46 processor = new ProxiProcessor();
47 event = PROXIMITY_BASE_DATA_SET;
50 else if (name == "accel") {
51 processor = new AccelProcessor();
52 event = ACCELEROMETER_BASE_DATA_SET;
55 else if (name == "gyro") {
56 processor = new GyroProcessor();
57 event = GYRO_BASE_DATA_SET;
58 } else if (name == "pressure") {
59 processor = new PressureProcessor();
60 event = PRESSURE_BASE_DATA_SET;
61 } else if (name == "temperature") {
62 processor = new TemperatureProcessor();
63 event = PRESSURE_BASE_DATA_SET;
68 cout <<"Give processor name: compass, light, proxi, accel,"
69 <<"gyro, pressure, temperature";
77 //std::cerr <<"Going to read" <<processor;
78 BaseProcessor::started(processor);
79 //std::cerr <<"Return from read\n";
81 base_data_struct result;
83 processor->get_struct_value(event,&result);
84 cerr <<"Values from sensor: \n";
85 for (int i =0; i <result.values_num; i++)
86 cerr <<i <<":" <<result.values[i] <<"\n";
87 cerr <<"Values end\n";