From cd1123aea0257b0fb77b7d29aa622a5d9b6781fe Mon Sep 17 00:00:00 2001 From: Adarsh Shree Ram Date: Thu, 22 Oct 2015 12:21:19 +0530 Subject: [PATCH 01/16] Restructuring the sensord framework codebase The codebase is segregated into 4 directories :libsensord,server,shared and plugins .The plugins directory contains all the sensor plugins under one folder. Changes: Moved all individual sensor folders into a single folder plugins/ Moved sensor_event definitions files from libsensord(client) to shared as they are being used by plugins/server/client Change-Id: I42900352c7068cf9fde188a83c92580c62274168 --- src/CMakeLists.txt | 37 +++++++++++---------- src/libsensord/CMakeLists.txt | 25 +------------- src/{ => plugins}/accel/CMakeLists.txt | 0 src/{ => plugins}/accel/accel_sensor.cpp | 0 src/{ => plugins}/accel/accel_sensor.h | 0 src/{ => plugins}/accel/accel_sensor_hal.cpp | 0 src/{ => plugins}/accel/accel_sensor_hal.h | 0 src/{ => plugins}/auto_rotation/CMakeLists.txt | 0 .../auto_rotation/auto_rotation_alg.cpp | 0 .../auto_rotation/auto_rotation_alg.h | 0 .../auto_rotation/auto_rotation_alg_emul.cpp | 0 .../auto_rotation/auto_rotation_alg_emul.h | 0 .../auto_rotation/auto_rotation_sensor.cpp | 0 .../auto_rotation/auto_rotation_sensor.h | 0 src/{ => plugins}/bio_led_red/CMakeLists.txt | 0 .../bio_led_red/bio_led_red_sensor.cpp | 0 src/{ => plugins}/bio_led_red/bio_led_red_sensor.h | 0 .../bio_led_red/bio_led_red_sensor_hal.cpp | 0 .../bio_led_red/bio_led_red_sensor_hal.h | 0 src/{ => plugins}/fusion/CMakeLists.txt | 2 +- src/{ => plugins}/fusion/fusion_sensor.cpp | 0 src/{ => plugins}/fusion/fusion_sensor.h | 0 .../fusion/hardware_fusion_sensor.html | 0 src/{ => plugins}/geo/CMakeLists.txt | 0 src/{ => plugins}/geo/geo_sensor.cpp | 0 src/{ => plugins}/geo/geo_sensor.h | 0 src/{ => plugins}/geo/geo_sensor_hal.cpp | 0 src/{ => plugins}/geo/geo_sensor_hal.h | 0 src/{ => plugins}/gravity/CMakeLists.txt | 2 +- src/{ => plugins}/gravity/gravity_sensor.cpp | 0 src/{ => plugins}/gravity/gravity_sensor.h | 0 src/{ => plugins}/gyro/CMakeLists.txt | 0 src/{ => plugins}/gyro/gyro_sensor.cpp | 0 src/{ => plugins}/gyro/gyro_sensor.h | 0 src/{ => plugins}/gyro/gyro_sensor_hal.cpp | 0 src/{ => plugins}/gyro/gyro_sensor_hal.h | 0 src/{ => plugins}/light/CMakeLists.txt | 0 src/{ => plugins}/light/light_sensor.cpp | 0 src/{ => plugins}/light/light_sensor.h | 0 src/{ => plugins}/light/light_sensor_hal.cpp | 0 src/{ => plugins}/light/light_sensor_hal.h | 0 src/{ => plugins}/linear_accel/CMakeLists.txt | 2 +- .../linear_accel/linear_accel_sensor.cpp | 0 .../linear_accel/linear_accel_sensor.h | 0 src/{ => plugins}/orientation/CMakeLists.txt | 2 +- .../orientation/orientation_sensor.cpp | 0 src/{ => plugins}/orientation/orientation_sensor.h | 0 src/{ => plugins}/pressure/CMakeLists.txt | 0 src/{ => plugins}/pressure/pressure_sensor.cpp | 0 src/{ => plugins}/pressure/pressure_sensor.h | 0 src/{ => plugins}/pressure/pressure_sensor_hal.cpp | 0 src/{ => plugins}/pressure/pressure_sensor_hal.h | 0 src/{ => plugins}/proxi/CMakeLists.txt | 0 src/{ => plugins}/proxi/proxi_sensor.cpp | 0 src/{ => plugins}/proxi/proxi_sensor.h | 0 src/{ => plugins}/proxi/proxi_sensor_hal.cpp | 0 src/{ => plugins}/proxi/proxi_sensor_hal.h | 0 src/{ => plugins}/rotation_vector/CMakeLists.txt | 0 .../rotation_vector/gaming_rv/CMakeLists.txt | 2 +- .../rotation_vector/gaming_rv/gaming_rv_sensor.cpp | 0 .../rotation_vector/gaming_rv/gaming_rv_sensor.h | 0 .../rotation_vector/geomagnetic_rv/CMakeLists.txt | 2 +- .../geomagnetic_rv/geomagnetic_rv_sensor.cpp | 0 .../geomagnetic_rv/geomagnetic_rv_sensor.h | 0 .../rotation_vector/rv/CMakeLists.txt | 2 +- src/{ => plugins}/rotation_vector/rv/rv_sensor.cpp | 0 src/{ => plugins}/rotation_vector/rv/rv_sensor.h | 0 .../rotation_vector/rv_raw/CMakeLists.txt | 0 .../rotation_vector/rv_raw/rv_raw_sensor.cpp | 0 .../rotation_vector/rv_raw/rv_raw_sensor.h | 0 .../rotation_vector/rv_raw/rv_raw_sensor_hal.cpp | 0 .../rotation_vector/rv_raw/rv_raw_sensor_hal.h | 0 src/{ => plugins}/sensor_fusion/CMakeLists.txt | 0 .../data/100ms/gravity/single_roll_throw/accel.txt | 0 .../data/100ms/gravity/single_roll_throw/gyro.txt | 0 .../100ms/gravity/single_roll_throw/magnetic.txt | 0 .../100ms/linear_acceleration/move_x_y_z/accel.txt | 0 .../100ms/linear_acceleration/move_x_y_z/gyro.txt | 0 .../linear_acceleration/move_x_y_z/magnetic.txt | 0 .../100ms/orientation/roll_pitch_yaw/accel.txt | 0 .../data/100ms/orientation/roll_pitch_yaw/gyro.txt | 0 .../100ms/orientation/roll_pitch_yaw/magnetic.txt | 0 .../data/25ms/pedo/Climb_stairs_down/In_hand/accel | 0 .../data/25ms/pedo/Climb_stairs_down/In_hand/gyro | 0 .../25ms/pedo/Climb_stairs_down/In_hand/magnetic | 0 .../25ms/pedo/Climb_stairs_down/Pant_pocket/accel | 0 .../25ms/pedo/Climb_stairs_down/Pant_pocket/gyro | 0 .../pedo/Climb_stairs_down/Pant_pocket/magnetic | 0 .../25ms/pedo/Climb_stairs_down/Shirt_pocket/accel | 0 .../25ms/pedo/Climb_stairs_down/Shirt_pocket/gyro | 0 .../pedo/Climb_stairs_down/Shirt_pocket/magnetic | 0 .../pedo/Climb_stairs_down/While_talking/accel | 0 .../25ms/pedo/Climb_stairs_down/While_talking/gyro | 0 .../pedo/Climb_stairs_down/While_talking/magnetic | 0 .../data/25ms/pedo/Climb_stairs_up/In_hand/accel | 0 .../data/25ms/pedo/Climb_stairs_up/In_hand/gyro | 0 .../25ms/pedo/Climb_stairs_up/In_hand/magnetic | 0 .../25ms/pedo/Climb_stairs_up/Pant_pocket/accel | 0 .../25ms/pedo/Climb_stairs_up/Pant_pocket/gyro | 0 .../25ms/pedo/Climb_stairs_up/Pant_pocket/magnetic | 0 .../25ms/pedo/Climb_stairs_up/Shirt_pocket/accel | 0 .../25ms/pedo/Climb_stairs_up/Shirt_pocket/gyro | 0 .../pedo/Climb_stairs_up/Shirt_pocket/magnetic | 0 .../25ms/pedo/Climb_stairs_up/While_talking/accel | 0 .../25ms/pedo/Climb_stairs_up/While_talking/gyro | 0 .../pedo/Climb_stairs_up/While_talking/magnetic | 0 .../design/data/25ms/pedo/Walk_fast/In_hand/accel | 0 .../design/data/25ms/pedo/Walk_fast/In_hand/gyro | 0 .../data/25ms/pedo/Walk_fast/In_hand/magnetic | 0 .../data/25ms/pedo/Walk_fast/Pant_pocket/accel | 0 .../data/25ms/pedo/Walk_fast/Pant_pocket/gyro | 0 .../data/25ms/pedo/Walk_fast/Pant_pocket/magnetic | 0 .../data/25ms/pedo/Walk_fast/Shirt_pocket/accel | 0 .../data/25ms/pedo/Walk_fast/Shirt_pocket/gyro | 0 .../data/25ms/pedo/Walk_fast/Shirt_pocket/magnetic | 0 .../data/25ms/pedo/Walk_fast/While_talking/accel | 0 .../data/25ms/pedo/Walk_fast/While_talking/gyro | 0 .../25ms/pedo/Walk_fast/While_talking/magnetic | 0 .../design/data/25ms/pedo/Walk_slow/In_hand/accel | 0 .../design/data/25ms/pedo/Walk_slow/In_hand/gyro | 0 .../data/25ms/pedo/Walk_slow/In_hand/magnetic | 0 .../data/25ms/pedo/Walk_slow/Pant_pocket/accel | 0 .../data/25ms/pedo/Walk_slow/Pant_pocket/gyro | 0 .../data/25ms/pedo/Walk_slow/Pant_pocket/magnetic | 0 .../data/25ms/pedo/Walk_slow/Shirt_pocket/accel | 0 .../data/25ms/pedo/Walk_slow/Shirt_pocket/gyro | 0 .../data/25ms/pedo/Walk_slow/Shirt_pocket/magnetic | 0 .../data/25ms/pedo/Walk_slow/While_talking/accel | 0 .../data/25ms/pedo/Walk_slow/While_talking/gyro | 0 .../25ms/pedo/Walk_slow/While_talking/magnetic | 0 ...ock_diagram_gravity_and_linear_acceleration.png | Bin .../block_diagram_orientation_estimation.png | Bin .../documentation/diagram/device_orientation.png | Bin .../documentation/diagram/kalman_filter_stages.png | Bin .../diagram/orientation_effect_on_gravity.png | Bin .../projection_diagram_gravity_computation.png | Bin .../design/documentation/equation/equation_1.png | Bin .../design/documentation/equation/equation_10.png | Bin .../design/documentation/equation/equation_11.png | Bin .../design/documentation/equation/equation_12.png | Bin .../design/documentation/equation/equation_13.png | Bin .../documentation/equation/equation_13_updated.png | Bin .../design/documentation/equation/equation_14.png | Bin .../design/documentation/equation/equation_15.png | Bin .../design/documentation/equation/equation_16.png | Bin .../design/documentation/equation/equation_17.png | Bin .../design/documentation/equation/equation_18.png | Bin .../design/documentation/equation/equation_19.png | Bin .../design/documentation/equation/equation_2.png | Bin .../design/documentation/equation/equation_20.png | Bin .../design/documentation/equation/equation_21.png | Bin .../design/documentation/equation/equation_22.png | Bin .../design/documentation/equation/equation_23.png | Bin .../design/documentation/equation/equation_24.png | Bin .../design/documentation/equation/equation_25.png | Bin .../design/documentation/equation/equation_26.png | Bin .../design/documentation/equation/equation_27.png | Bin .../design/documentation/equation/equation_28.png | Bin .../design/documentation/equation/equation_29.png | Bin .../design/documentation/equation/equation_3.png | Bin .../design/documentation/equation/equation_30.png | Bin .../design/documentation/equation/equation_31.png | Bin .../design/documentation/equation/equation_32.png | Bin .../design/documentation/equation/equation_33.png | Bin .../design/documentation/equation/equation_34.png | Bin .../design/documentation/equation/equation_35.png | Bin .../design/documentation/equation/equation_36.png | Bin .../design/documentation/equation/equation_37.png | Bin .../design/documentation/equation/equation_38.png | Bin .../design/documentation/equation/equation_39.png | Bin .../design/documentation/equation/equation_4.png | Bin .../design/documentation/equation/equation_40.png | Bin .../design/documentation/equation/equation_5.png | Bin .../design/documentation/equation/equation_6.png | Bin .../design/documentation/equation/equation_7.png | Bin .../design/documentation/equation/equation_8.png | Bin .../design/documentation/equation/equation_9.png | Bin .../design/documentation/sensor_fusion.htm | 0 .../sensor_fusion/design/lib/axis_rot2quat.m | 0 .../sensor_fusion/design/lib/estimate_gaming_rv.m | 0 .../design/lib/estimate_geomagnetic_rv.m | 0 .../sensor_fusion/design/lib/estimate_gravity.m | 0 .../design/lib/estimate_linear_acceleration.m | 0 .../design/lib/estimate_orientation.m | 0 .../sensor_fusion/design/lib/euler2quat.m | 0 .../sensor_fusion/design/lib/quat2euler.m | 0 .../sensor_fusion/design/lib/quat2rot_mat.m | 0 .../sensor_fusion/design/lib/quat_prod.m | 0 .../sensor_fusion/design/lib/rot_mat2quat.m | 0 .../sensor_fusion/design/lib/sf_pedometer.m | 0 src/{ => plugins}/sensor_fusion/design/readme | 0 .../sensor_fusion/design/sf_gaming_rv.m | 0 .../sensor_fusion/design/sf_geomagnetic_rv.m | 0 .../sensor_fusion/design/sf_gravity.m | 0 .../sensor_fusion/design/sf_linear_acceleration.m | 0 .../sensor_fusion/design/sf_orientation.m | 0 src/{ => plugins}/sensor_fusion/euler_angles.cpp | 0 src/{ => plugins}/sensor_fusion/euler_angles.h | 0 src/{ => plugins}/sensor_fusion/matrix.cpp | 0 src/{ => plugins}/sensor_fusion/matrix.h | 0 .../sensor_fusion/orientation_filter.cpp | 0 .../sensor_fusion/orientation_filter.h | 0 src/{ => plugins}/sensor_fusion/quaternion.cpp | 0 src/{ => plugins}/sensor_fusion/quaternion.h | 0 .../sensor_fusion/rotation_matrix.cpp | 0 src/{ => plugins}/sensor_fusion/rotation_matrix.h | 0 src/{ => plugins}/sensor_fusion/sensor_data.cpp | 0 src/{ => plugins}/sensor_fusion/sensor_data.h | 0 .../sensor_fusion/test/gravity_sensor.cpp | 0 .../sensor_fusion/test/gravity_sensor.h | 0 .../test/linear_acceleration_sensor.cpp | 0 .../test/linear_acceleration_sensor.h | 0 .../sensor_fusion/test/orientation_sensor.cpp | 0 .../sensor_fusion/test/orientation_sensor.h | 0 .../test/test_projects/euler_angles_test/.cproject | 0 .../test/test_projects/euler_angles_test/.project | 0 .../euler_angles_test/euler_angles_main.cpp | 0 .../test_projects/gravity_sensor_test/.cproject | 0 .../test_projects/gravity_sensor_test/.project | 0 .../gravity_sensor_test/gravity_sensor_main.cpp | 0 .../linear_acceleration_sensor_test/.cproject | 0 .../linear_acceleration_sensor_test/.project | 0 .../linear_acceleration_sensor_main.cpp | 0 .../test/test_projects/matrix_test/.cproject | 0 .../test/test_projects/matrix_test/.project | 0 .../test/test_projects/matrix_test/matrix_main.cpp | 0 .../orientation_sensor_test/.cproject | 0 .../test_projects/orientation_sensor_test/.project | 0 .../orientation_sensor_main.cpp | 0 .../test/test_projects/quaternion_test/.cproject | 0 .../test/test_projects/quaternion_test/.project | 0 .../quaternion_test/quaternion_main.cpp | 0 .../test_projects/rotation_matrix_test/.cproject | 0 .../test_projects/rotation_matrix_test/.project | 0 .../rotation_matrix_test/rotation_matrix_main.cpp | 0 .../test/test_projects/sensor_data_test/.cproject | 0 .../test/test_projects/sensor_data_test/.project | 0 .../sensor_data_test/sensor_data_main.cpp | 0 .../test/test_projects/vector_test/.cproject | 0 .../test/test_projects/vector_test/.project | 0 .../test/test_projects/vector_test/vector_main.cpp | 0 src/{ => plugins}/sensor_fusion/vector.cpp | 0 src/{ => plugins}/sensor_fusion/vector.h | 0 src/{ => plugins}/temperature/CMakeLists.txt | 0 .../temperature/temperature_sensor.cpp | 0 src/{ => plugins}/temperature/temperature_sensor.h | 0 .../temperature/temperature_sensor_hal.cpp | 0 .../temperature/temperature_sensor_hal.h | 0 src/{ => plugins}/tilt/CMakeLists.txt | 2 +- src/{ => plugins}/tilt/tilt_sensor.cpp | 0 src/{ => plugins}/tilt/tilt_sensor.h | 0 src/{ => plugins}/ultraviolet/CMakeLists.txt | 0 .../ultraviolet/ultraviolet_sensor.cpp | 0 src/{ => plugins}/ultraviolet/ultraviolet_sensor.h | 0 .../ultraviolet/ultraviolet_sensor_hal.cpp | 0 .../ultraviolet/ultraviolet_sensor_hal.h | 0 src/{ => plugins}/uncal_gyro/CMakeLists.txt | 2 +- src/{ => plugins}/uncal_gyro/uncal_gyro_sensor.cpp | 0 src/{ => plugins}/uncal_gyro/uncal_gyro_sensor.h | 0 src/shared/CMakeLists.txt | 24 +++++++++++++ src/{libsensord => shared}/sensor_accel.h | 0 src/{libsensord => shared}/sensor_auto_rotation.h | 0 src/{libsensord => shared}/sensor_bio_led_red.h | 0 src/{libsensord => shared}/sensor_context.h | 0 src/{libsensord => shared}/sensor_deprecated.h | 0 src/{libsensord => shared}/sensor_fusion.h | 0 src/{libsensord => shared}/sensor_gaming_rv.h | 0 src/{libsensord => shared}/sensor_geomag.h | 0 src/{libsensord => shared}/sensor_geomagnetic_rv.h | 0 src/{libsensord => shared}/sensor_gravity.h | 0 src/{libsensord => shared}/sensor_gyro.h | 0 src/{libsensord => shared}/sensor_internal.h | 0 .../sensor_internal_deprecated.h | 0 src/{libsensord => shared}/sensor_light.h | 0 src/{libsensord => shared}/sensor_linear_accel.h | 0 src/{libsensord => shared}/sensor_motion.h | 0 src/{libsensord => shared}/sensor_orientation.h | 0 src/{libsensord => shared}/sensor_pressure.h | 0 src/{libsensord => shared}/sensor_proxi.h | 0 src/{libsensord => shared}/sensor_rv.h | 0 src/{libsensord => shared}/sensor_temperature.h | 0 src/{libsensord => shared}/sensor_tilt.h | 0 src/{libsensord => shared}/sensor_ultraviolet.h | 0 src/{libsensord => shared}/sensor_uncal_gyro.h | 0 284 files changed, 53 insertions(+), 51 deletions(-) rename src/{ => plugins}/accel/CMakeLists.txt (100%) rename src/{ => plugins}/accel/accel_sensor.cpp (100%) rename src/{ => plugins}/accel/accel_sensor.h (100%) rename src/{ => plugins}/accel/accel_sensor_hal.cpp (100%) rename src/{ => plugins}/accel/accel_sensor_hal.h (100%) rename src/{ => plugins}/auto_rotation/CMakeLists.txt (100%) rename src/{ => plugins}/auto_rotation/auto_rotation_alg.cpp (100%) rename src/{ => plugins}/auto_rotation/auto_rotation_alg.h (100%) rename src/{ => plugins}/auto_rotation/auto_rotation_alg_emul.cpp (100%) rename src/{ => plugins}/auto_rotation/auto_rotation_alg_emul.h (100%) rename src/{ => plugins}/auto_rotation/auto_rotation_sensor.cpp (100%) rename src/{ => plugins}/auto_rotation/auto_rotation_sensor.h (100%) rename src/{ => plugins}/bio_led_red/CMakeLists.txt (100%) rename src/{ => plugins}/bio_led_red/bio_led_red_sensor.cpp (100%) rename src/{ => plugins}/bio_led_red/bio_led_red_sensor.h (100%) rename src/{ => plugins}/bio_led_red/bio_led_red_sensor_hal.cpp (100%) rename src/{ => plugins}/bio_led_red/bio_led_red_sensor_hal.h (100%) rename src/{ => plugins}/fusion/CMakeLists.txt (90%) rename src/{ => plugins}/fusion/fusion_sensor.cpp (100%) rename src/{ => plugins}/fusion/fusion_sensor.h (100%) rename src/{ => plugins}/fusion/hardware_fusion_sensor.html (100%) rename src/{ => plugins}/geo/CMakeLists.txt (100%) rename src/{ => plugins}/geo/geo_sensor.cpp (100%) rename src/{ => plugins}/geo/geo_sensor.h (100%) rename src/{ => plugins}/geo/geo_sensor_hal.cpp (100%) rename src/{ => plugins}/geo/geo_sensor_hal.h (100%) rename src/{ => plugins}/gravity/CMakeLists.txt (90%) rename src/{ => plugins}/gravity/gravity_sensor.cpp (100%) rename src/{ => plugins}/gravity/gravity_sensor.h (100%) rename src/{ => plugins}/gyro/CMakeLists.txt (100%) rename src/{ => plugins}/gyro/gyro_sensor.cpp (100%) rename src/{ => plugins}/gyro/gyro_sensor.h (100%) rename src/{ => plugins}/gyro/gyro_sensor_hal.cpp (100%) rename src/{ => plugins}/gyro/gyro_sensor_hal.h (100%) rename src/{ => plugins}/light/CMakeLists.txt (100%) rename src/{ => plugins}/light/light_sensor.cpp (100%) rename src/{ => plugins}/light/light_sensor.h (100%) rename src/{ => plugins}/light/light_sensor_hal.cpp (100%) rename src/{ => plugins}/light/light_sensor_hal.h (100%) rename src/{ => plugins}/linear_accel/CMakeLists.txt (90%) rename src/{ => plugins}/linear_accel/linear_accel_sensor.cpp (100%) rename src/{ => plugins}/linear_accel/linear_accel_sensor.h (100%) rename src/{ => plugins}/orientation/CMakeLists.txt (90%) rename src/{ => plugins}/orientation/orientation_sensor.cpp (100%) rename src/{ => plugins}/orientation/orientation_sensor.h (100%) rename src/{ => plugins}/pressure/CMakeLists.txt (100%) rename src/{ => plugins}/pressure/pressure_sensor.cpp (100%) rename src/{ => plugins}/pressure/pressure_sensor.h (100%) rename src/{ => plugins}/pressure/pressure_sensor_hal.cpp (100%) rename src/{ => plugins}/pressure/pressure_sensor_hal.h (100%) rename src/{ => plugins}/proxi/CMakeLists.txt (100%) rename src/{ => plugins}/proxi/proxi_sensor.cpp (100%) rename src/{ => plugins}/proxi/proxi_sensor.h (100%) rename src/{ => plugins}/proxi/proxi_sensor_hal.cpp (100%) rename src/{ => plugins}/proxi/proxi_sensor_hal.h (100%) rename src/{ => plugins}/rotation_vector/CMakeLists.txt (100%) rename src/{ => plugins}/rotation_vector/gaming_rv/CMakeLists.txt (90%) rename src/{ => plugins}/rotation_vector/gaming_rv/gaming_rv_sensor.cpp (100%) rename src/{ => plugins}/rotation_vector/gaming_rv/gaming_rv_sensor.h (100%) rename src/{ => plugins}/rotation_vector/geomagnetic_rv/CMakeLists.txt (90%) rename src/{ => plugins}/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp (100%) rename src/{ => plugins}/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.h (100%) rename src/{ => plugins}/rotation_vector/rv/CMakeLists.txt (89%) rename src/{ => plugins}/rotation_vector/rv/rv_sensor.cpp (100%) rename src/{ => plugins}/rotation_vector/rv/rv_sensor.h (100%) rename src/{ => plugins}/rotation_vector/rv_raw/CMakeLists.txt (100%) rename src/{ => plugins}/rotation_vector/rv_raw/rv_raw_sensor.cpp (100%) rename src/{ => plugins}/rotation_vector/rv_raw/rv_raw_sensor.h (100%) rename src/{ => plugins}/rotation_vector/rv_raw/rv_raw_sensor_hal.cpp (100%) rename src/{ => plugins}/rotation_vector/rv_raw/rv_raw_sensor_hal.h (100%) rename src/{ => plugins}/sensor_fusion/CMakeLists.txt (100%) rename src/{ => plugins}/sensor_fusion/design/data/100ms/gravity/single_roll_throw/accel.txt (100%) rename src/{ => plugins}/sensor_fusion/design/data/100ms/gravity/single_roll_throw/gyro.txt (100%) rename src/{ => plugins}/sensor_fusion/design/data/100ms/gravity/single_roll_throw/magnetic.txt (100%) rename src/{ => plugins}/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/accel.txt (100%) rename src/{ => plugins}/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/gyro.txt (100%) rename src/{ => plugins}/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/magnetic.txt (100%) rename src/{ => plugins}/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/accel.txt (100%) rename src/{ => plugins}/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/gyro.txt (100%) rename src/{ => plugins}/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/magnetic.txt (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/accel (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/gyro (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/magnetic (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/accel (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/gyro (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/magnetic (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/accel (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/gyro (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/magnetic (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/accel (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/gyro (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/magnetic (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/accel (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/gyro (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/magnetic (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/accel (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/gyro (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/magnetic (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/accel (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/gyro (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/magnetic (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/accel (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/gyro (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/magnetic (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/accel (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/gyro (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/magnetic (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/accel (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/gyro (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/magnetic (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/accel (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/gyro (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/magnetic (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/accel (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/gyro (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/magnetic (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/accel (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/gyro (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/magnetic (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/accel (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/gyro (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/magnetic (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/accel (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/gyro (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/magnetic (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/accel (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/gyro (100%) rename src/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/magnetic (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/diagram/block_diagram_gravity_and_linear_acceleration.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/diagram/block_diagram_orientation_estimation.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/diagram/device_orientation.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/diagram/kalman_filter_stages.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/diagram/orientation_effect_on_gravity.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/diagram/projection_diagram_gravity_computation.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_1.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_10.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_11.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_12.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_13.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_13_updated.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_14.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_15.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_16.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_17.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_18.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_19.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_2.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_20.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_21.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_22.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_23.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_24.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_25.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_26.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_27.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_28.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_29.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_3.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_30.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_31.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_32.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_33.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_34.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_35.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_36.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_37.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_38.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_39.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_4.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_40.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_5.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_6.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_7.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_8.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/equation/equation_9.png (100%) rename src/{ => plugins}/sensor_fusion/design/documentation/sensor_fusion.htm (100%) rename src/{ => plugins}/sensor_fusion/design/lib/axis_rot2quat.m (100%) rename src/{ => plugins}/sensor_fusion/design/lib/estimate_gaming_rv.m (100%) rename src/{ => plugins}/sensor_fusion/design/lib/estimate_geomagnetic_rv.m (100%) rename src/{ => plugins}/sensor_fusion/design/lib/estimate_gravity.m (100%) rename src/{ => plugins}/sensor_fusion/design/lib/estimate_linear_acceleration.m (100%) rename src/{ => plugins}/sensor_fusion/design/lib/estimate_orientation.m (100%) rename src/{ => plugins}/sensor_fusion/design/lib/euler2quat.m (100%) rename src/{ => plugins}/sensor_fusion/design/lib/quat2euler.m (100%) rename src/{ => plugins}/sensor_fusion/design/lib/quat2rot_mat.m (100%) rename src/{ => plugins}/sensor_fusion/design/lib/quat_prod.m (100%) rename src/{ => plugins}/sensor_fusion/design/lib/rot_mat2quat.m (100%) rename src/{ => plugins}/sensor_fusion/design/lib/sf_pedometer.m (100%) rename src/{ => plugins}/sensor_fusion/design/readme (100%) rename src/{ => plugins}/sensor_fusion/design/sf_gaming_rv.m (100%) rename src/{ => plugins}/sensor_fusion/design/sf_geomagnetic_rv.m (100%) rename src/{ => plugins}/sensor_fusion/design/sf_gravity.m (100%) rename src/{ => plugins}/sensor_fusion/design/sf_linear_acceleration.m (100%) rename src/{ => plugins}/sensor_fusion/design/sf_orientation.m (100%) rename src/{ => plugins}/sensor_fusion/euler_angles.cpp (100%) rename src/{ => plugins}/sensor_fusion/euler_angles.h (100%) rename src/{ => plugins}/sensor_fusion/matrix.cpp (100%) rename src/{ => plugins}/sensor_fusion/matrix.h (100%) rename src/{ => plugins}/sensor_fusion/orientation_filter.cpp (100%) rename src/{ => plugins}/sensor_fusion/orientation_filter.h (100%) rename src/{ => plugins}/sensor_fusion/quaternion.cpp (100%) rename src/{ => plugins}/sensor_fusion/quaternion.h (100%) rename src/{ => plugins}/sensor_fusion/rotation_matrix.cpp (100%) rename src/{ => plugins}/sensor_fusion/rotation_matrix.h (100%) rename src/{ => plugins}/sensor_fusion/sensor_data.cpp (100%) rename src/{ => plugins}/sensor_fusion/sensor_data.h (100%) rename src/{ => plugins}/sensor_fusion/test/gravity_sensor.cpp (100%) rename src/{ => plugins}/sensor_fusion/test/gravity_sensor.h (100%) rename src/{ => plugins}/sensor_fusion/test/linear_acceleration_sensor.cpp (100%) rename src/{ => plugins}/sensor_fusion/test/linear_acceleration_sensor.h (100%) rename src/{ => plugins}/sensor_fusion/test/orientation_sensor.cpp (100%) rename src/{ => plugins}/sensor_fusion/test/orientation_sensor.h (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/euler_angles_test/.cproject (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/euler_angles_test/.project (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/euler_angles_test/euler_angles_main.cpp (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/gravity_sensor_test/.cproject (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/gravity_sensor_test/.project (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/gravity_sensor_test/gravity_sensor_main.cpp (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.cproject (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.project (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/linear_acceleration_sensor_main.cpp (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/matrix_test/.cproject (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/matrix_test/.project (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/matrix_test/matrix_main.cpp (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/orientation_sensor_test/.cproject (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/orientation_sensor_test/.project (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/orientation_sensor_test/orientation_sensor_main.cpp (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/quaternion_test/.cproject (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/quaternion_test/.project (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/quaternion_test/quaternion_main.cpp (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/rotation_matrix_test/.cproject (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/rotation_matrix_test/.project (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/rotation_matrix_test/rotation_matrix_main.cpp (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/sensor_data_test/.cproject (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/sensor_data_test/.project (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/sensor_data_test/sensor_data_main.cpp (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/vector_test/.cproject (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/vector_test/.project (100%) rename src/{ => plugins}/sensor_fusion/test/test_projects/vector_test/vector_main.cpp (100%) rename src/{ => plugins}/sensor_fusion/vector.cpp (100%) rename src/{ => plugins}/sensor_fusion/vector.h (100%) rename src/{ => plugins}/temperature/CMakeLists.txt (100%) rename src/{ => plugins}/temperature/temperature_sensor.cpp (100%) rename src/{ => plugins}/temperature/temperature_sensor.h (100%) rename src/{ => plugins}/temperature/temperature_sensor_hal.cpp (100%) rename src/{ => plugins}/temperature/temperature_sensor_hal.h (100%) rename src/{ => plugins}/tilt/CMakeLists.txt (89%) rename src/{ => plugins}/tilt/tilt_sensor.cpp (100%) rename src/{ => plugins}/tilt/tilt_sensor.h (100%) rename src/{ => plugins}/ultraviolet/CMakeLists.txt (100%) rename src/{ => plugins}/ultraviolet/ultraviolet_sensor.cpp (100%) rename src/{ => plugins}/ultraviolet/ultraviolet_sensor.h (100%) rename src/{ => plugins}/ultraviolet/ultraviolet_sensor_hal.cpp (100%) rename src/{ => plugins}/ultraviolet/ultraviolet_sensor_hal.h (100%) rename src/{ => plugins}/uncal_gyro/CMakeLists.txt (90%) rename src/{ => plugins}/uncal_gyro/uncal_gyro_sensor.cpp (100%) rename src/{ => plugins}/uncal_gyro/uncal_gyro_sensor.h (100%) rename src/{libsensord => shared}/sensor_accel.h (100%) rename src/{libsensord => shared}/sensor_auto_rotation.h (100%) rename src/{libsensord => shared}/sensor_bio_led_red.h (100%) rename src/{libsensord => shared}/sensor_context.h (100%) rename src/{libsensord => shared}/sensor_deprecated.h (100%) rename src/{libsensord => shared}/sensor_fusion.h (100%) rename src/{libsensord => shared}/sensor_gaming_rv.h (100%) rename src/{libsensord => shared}/sensor_geomag.h (100%) rename src/{libsensord => shared}/sensor_geomagnetic_rv.h (100%) rename src/{libsensord => shared}/sensor_gravity.h (100%) rename src/{libsensord => shared}/sensor_gyro.h (100%) rename src/{libsensord => shared}/sensor_internal.h (100%) rename src/{libsensord => shared}/sensor_internal_deprecated.h (100%) rename src/{libsensord => shared}/sensor_light.h (100%) rename src/{libsensord => shared}/sensor_linear_accel.h (100%) rename src/{libsensord => shared}/sensor_motion.h (100%) rename src/{libsensord => shared}/sensor_orientation.h (100%) rename src/{libsensord => shared}/sensor_pressure.h (100%) rename src/{libsensord => shared}/sensor_proxi.h (100%) rename src/{libsensord => shared}/sensor_rv.h (100%) rename src/{libsensord => shared}/sensor_temperature.h (100%) rename src/{libsensord => shared}/sensor_tilt.h (100%) rename src/{libsensord => shared}/sensor_ultraviolet.h (100%) rename src/{libsensord => shared}/sensor_uncal_gyro.h (100%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 91a8b40..1087d73 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,37 +5,37 @@ include_directories(${CMAKE_SOURCE_DIR}/src/shared) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) IF("${ACCEL}" STREQUAL "ON") -add_subdirectory(accel) +add_subdirectory(plugins/accel) ENDIF() IF("${GYRO}" STREQUAL "ON") -add_subdirectory(gyro) +add_subdirectory(plugins/gyro) ENDIF() IF("${PROXI}" STREQUAL "ON") -add_subdirectory(proxi) +add_subdirectory(plugins/proxi) ENDIF() IF("${LIGHT}" STREQUAL "ON") -add_subdirectory(light) +add_subdirectory(plugins/light) ENDIF() IF("${GEO}" STREQUAL "ON") -add_subdirectory(geo) +add_subdirectory(plugins/geo) ENDIF() IF("${AUTO_ROTATION}" STREQUAL "ON") -add_subdirectory(auto_rotation) +add_subdirectory(plugins/auto_rotation) ENDIF() IF("${PRESSURE}" STREQUAL "ON") -add_subdirectory(pressure) +add_subdirectory(plugins/pressure) ENDIF() IF("${TEMPERATURE}" STREQUAL "ON") -add_subdirectory(temperature) +add_subdirectory(plugins/temperature) ENDIF() IF("${HUMIDITY}" STREQUAL "ON") add_subdirectory(humidity) ENDIF() IF("${ULTRAVIOLET}" STREQUAL "ON") -add_subdirectory(ultraviolet) +add_subdirectory(plugins/ultraviolet) ENDIF() IF("${BIO_LED_RED}" STREQUAL "ON") -add_subdirectory(bio_led_red) +add_subdirectory(plugins/bio_led_red) ENDIF() IF("${ORIENTATION}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") @@ -67,26 +67,27 @@ set(GRAVITY_ENABLE "1") set(LINEAR_ACCELERATION_ENABLE "1") ENDIF() IF("${SENSOR_FUSION_ENABLE}" STREQUAL "1") -add_subdirectory(sensor_fusion) -add_subdirectory(fusion) +add_subdirectory(plugins/sensor_fusion) +add_subdirectory(plugins/fusion) ENDIF() IF("${ORIENTATION_ENABLE}" STREQUAL "1") -add_subdirectory(orientation) +add_subdirectory(plugins/orientation) ENDIF() IF("${GRAVITY_ENABLE}" STREQUAL "1") -add_subdirectory(gravity) +add_subdirectory(plugins/gravity) ENDIF() IF("${LINEAR_ACCELERATION_ENABLE}" STREQUAL "1") -add_subdirectory(linear_accel) +add_subdirectory(plugins/linear_accel) ENDIF() IF("${TILT_ENABLE}" STREQUAL "1") -add_subdirectory(tilt) +add_subdirectory(plugins/tilt) ENDIF() IF("${UNCAL_GYRO_ENABLE}" STREQUAL "1") -add_subdirectory(uncal_gyro) +add_subdirectory(plugins/uncal_gyro) ENDIF() -add_subdirectory(rotation_vector) +add_subdirectory(plugins/rotation_vector) add_subdirectory(server) add_subdirectory(libsensord) add_subdirectory(shared) + diff --git a/src/libsensord/CMakeLists.txt b/src/libsensord/CMakeLists.txt index 00e3a1b..3f989c8 100755 --- a/src/libsensord/CMakeLists.txt +++ b/src/libsensord/CMakeLists.txt @@ -35,34 +35,11 @@ SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION}) configure_file(${PROJECT_NAME}.pc.in ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc @ONLY) install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries) -install(FILES sensor_internal_deprecated.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_internal.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) install(FILES poller.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) install(FILES creg_event_info.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) install(FILES csensor_event_listener.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) install(FILES sensor_info_manager.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) install(FILES csensor_handle_info.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) install(FILES client_common.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_accel.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_geomag.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_light.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_proxi.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_gyro.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_pressure.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_context.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_auto_rotation.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_gravity.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_linear_accel.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_orientation.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_tilt.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_rv.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_geomagnetic_rv.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_gaming_rv.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_temperature.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_motion.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_fusion.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_ultraviolet.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_bio_led_red.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_deprecated.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_uncal_gyro.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) install(FILES ${PROJECT_NAME}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + diff --git a/src/accel/CMakeLists.txt b/src/plugins/accel/CMakeLists.txt similarity index 100% rename from src/accel/CMakeLists.txt rename to src/plugins/accel/CMakeLists.txt diff --git a/src/accel/accel_sensor.cpp b/src/plugins/accel/accel_sensor.cpp similarity index 100% rename from src/accel/accel_sensor.cpp rename to src/plugins/accel/accel_sensor.cpp diff --git a/src/accel/accel_sensor.h b/src/plugins/accel/accel_sensor.h similarity index 100% rename from src/accel/accel_sensor.h rename to src/plugins/accel/accel_sensor.h diff --git a/src/accel/accel_sensor_hal.cpp b/src/plugins/accel/accel_sensor_hal.cpp similarity index 100% rename from src/accel/accel_sensor_hal.cpp rename to src/plugins/accel/accel_sensor_hal.cpp diff --git a/src/accel/accel_sensor_hal.h b/src/plugins/accel/accel_sensor_hal.h similarity index 100% rename from src/accel/accel_sensor_hal.h rename to src/plugins/accel/accel_sensor_hal.h diff --git a/src/auto_rotation/CMakeLists.txt b/src/plugins/auto_rotation/CMakeLists.txt similarity index 100% rename from src/auto_rotation/CMakeLists.txt rename to src/plugins/auto_rotation/CMakeLists.txt diff --git a/src/auto_rotation/auto_rotation_alg.cpp b/src/plugins/auto_rotation/auto_rotation_alg.cpp similarity index 100% rename from src/auto_rotation/auto_rotation_alg.cpp rename to src/plugins/auto_rotation/auto_rotation_alg.cpp diff --git a/src/auto_rotation/auto_rotation_alg.h b/src/plugins/auto_rotation/auto_rotation_alg.h similarity index 100% rename from src/auto_rotation/auto_rotation_alg.h rename to src/plugins/auto_rotation/auto_rotation_alg.h diff --git a/src/auto_rotation/auto_rotation_alg_emul.cpp b/src/plugins/auto_rotation/auto_rotation_alg_emul.cpp similarity index 100% rename from src/auto_rotation/auto_rotation_alg_emul.cpp rename to src/plugins/auto_rotation/auto_rotation_alg_emul.cpp diff --git a/src/auto_rotation/auto_rotation_alg_emul.h b/src/plugins/auto_rotation/auto_rotation_alg_emul.h similarity index 100% rename from src/auto_rotation/auto_rotation_alg_emul.h rename to src/plugins/auto_rotation/auto_rotation_alg_emul.h diff --git a/src/auto_rotation/auto_rotation_sensor.cpp b/src/plugins/auto_rotation/auto_rotation_sensor.cpp similarity index 100% rename from src/auto_rotation/auto_rotation_sensor.cpp rename to src/plugins/auto_rotation/auto_rotation_sensor.cpp diff --git a/src/auto_rotation/auto_rotation_sensor.h b/src/plugins/auto_rotation/auto_rotation_sensor.h similarity index 100% rename from src/auto_rotation/auto_rotation_sensor.h rename to src/plugins/auto_rotation/auto_rotation_sensor.h diff --git a/src/bio_led_red/CMakeLists.txt b/src/plugins/bio_led_red/CMakeLists.txt similarity index 100% rename from src/bio_led_red/CMakeLists.txt rename to src/plugins/bio_led_red/CMakeLists.txt diff --git a/src/bio_led_red/bio_led_red_sensor.cpp b/src/plugins/bio_led_red/bio_led_red_sensor.cpp similarity index 100% rename from src/bio_led_red/bio_led_red_sensor.cpp rename to src/plugins/bio_led_red/bio_led_red_sensor.cpp diff --git a/src/bio_led_red/bio_led_red_sensor.h b/src/plugins/bio_led_red/bio_led_red_sensor.h similarity index 100% rename from src/bio_led_red/bio_led_red_sensor.h rename to src/plugins/bio_led_red/bio_led_red_sensor.h diff --git a/src/bio_led_red/bio_led_red_sensor_hal.cpp b/src/plugins/bio_led_red/bio_led_red_sensor_hal.cpp similarity index 100% rename from src/bio_led_red/bio_led_red_sensor_hal.cpp rename to src/plugins/bio_led_red/bio_led_red_sensor_hal.cpp diff --git a/src/bio_led_red/bio_led_red_sensor_hal.h b/src/plugins/bio_led_red/bio_led_red_sensor_hal.h similarity index 100% rename from src/bio_led_red/bio_led_red_sensor_hal.h rename to src/plugins/bio_led_red/bio_led_red_sensor_hal.h diff --git a/src/fusion/CMakeLists.txt b/src/plugins/fusion/CMakeLists.txt similarity index 90% rename from src/fusion/CMakeLists.txt rename to src/plugins/fusion/CMakeLists.txt index 9c6b3f4..131a2a8 100755 --- a/src/fusion/CMakeLists.txt +++ b/src/plugins/fusion/CMakeLists.txt @@ -5,7 +5,7 @@ SET(SENSOR_NAME fusion_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) -include_directories(${CMAKE_SOURCE_DIR}/src/sensor_fusion) +include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) FOREACH(flag ${fusion_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/fusion/fusion_sensor.cpp b/src/plugins/fusion/fusion_sensor.cpp similarity index 100% rename from src/fusion/fusion_sensor.cpp rename to src/plugins/fusion/fusion_sensor.cpp diff --git a/src/fusion/fusion_sensor.h b/src/plugins/fusion/fusion_sensor.h similarity index 100% rename from src/fusion/fusion_sensor.h rename to src/plugins/fusion/fusion_sensor.h diff --git a/src/fusion/hardware_fusion_sensor.html b/src/plugins/fusion/hardware_fusion_sensor.html similarity index 100% rename from src/fusion/hardware_fusion_sensor.html rename to src/plugins/fusion/hardware_fusion_sensor.html diff --git a/src/geo/CMakeLists.txt b/src/plugins/geo/CMakeLists.txt similarity index 100% rename from src/geo/CMakeLists.txt rename to src/plugins/geo/CMakeLists.txt diff --git a/src/geo/geo_sensor.cpp b/src/plugins/geo/geo_sensor.cpp similarity index 100% rename from src/geo/geo_sensor.cpp rename to src/plugins/geo/geo_sensor.cpp diff --git a/src/geo/geo_sensor.h b/src/plugins/geo/geo_sensor.h similarity index 100% rename from src/geo/geo_sensor.h rename to src/plugins/geo/geo_sensor.h diff --git a/src/geo/geo_sensor_hal.cpp b/src/plugins/geo/geo_sensor_hal.cpp similarity index 100% rename from src/geo/geo_sensor_hal.cpp rename to src/plugins/geo/geo_sensor_hal.cpp diff --git a/src/geo/geo_sensor_hal.h b/src/plugins/geo/geo_sensor_hal.h similarity index 100% rename from src/geo/geo_sensor_hal.h rename to src/plugins/geo/geo_sensor_hal.h diff --git a/src/gravity/CMakeLists.txt b/src/plugins/gravity/CMakeLists.txt similarity index 90% rename from src/gravity/CMakeLists.txt rename to src/plugins/gravity/CMakeLists.txt index 9ebbb00..5491c47 100755 --- a/src/gravity/CMakeLists.txt +++ b/src/plugins/gravity/CMakeLists.txt @@ -5,7 +5,7 @@ SET(SENSOR_NAME gravity_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) -include_directories(${CMAKE_SOURCE_DIR}/src/sensor_fusion) +include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) FOREACH(flag ${gravity_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/gravity/gravity_sensor.cpp b/src/plugins/gravity/gravity_sensor.cpp similarity index 100% rename from src/gravity/gravity_sensor.cpp rename to src/plugins/gravity/gravity_sensor.cpp diff --git a/src/gravity/gravity_sensor.h b/src/plugins/gravity/gravity_sensor.h similarity index 100% rename from src/gravity/gravity_sensor.h rename to src/plugins/gravity/gravity_sensor.h diff --git a/src/gyro/CMakeLists.txt b/src/plugins/gyro/CMakeLists.txt similarity index 100% rename from src/gyro/CMakeLists.txt rename to src/plugins/gyro/CMakeLists.txt diff --git a/src/gyro/gyro_sensor.cpp b/src/plugins/gyro/gyro_sensor.cpp similarity index 100% rename from src/gyro/gyro_sensor.cpp rename to src/plugins/gyro/gyro_sensor.cpp diff --git a/src/gyro/gyro_sensor.h b/src/plugins/gyro/gyro_sensor.h similarity index 100% rename from src/gyro/gyro_sensor.h rename to src/plugins/gyro/gyro_sensor.h diff --git a/src/gyro/gyro_sensor_hal.cpp b/src/plugins/gyro/gyro_sensor_hal.cpp similarity index 100% rename from src/gyro/gyro_sensor_hal.cpp rename to src/plugins/gyro/gyro_sensor_hal.cpp diff --git a/src/gyro/gyro_sensor_hal.h b/src/plugins/gyro/gyro_sensor_hal.h similarity index 100% rename from src/gyro/gyro_sensor_hal.h rename to src/plugins/gyro/gyro_sensor_hal.h diff --git a/src/light/CMakeLists.txt b/src/plugins/light/CMakeLists.txt similarity index 100% rename from src/light/CMakeLists.txt rename to src/plugins/light/CMakeLists.txt diff --git a/src/light/light_sensor.cpp b/src/plugins/light/light_sensor.cpp similarity index 100% rename from src/light/light_sensor.cpp rename to src/plugins/light/light_sensor.cpp diff --git a/src/light/light_sensor.h b/src/plugins/light/light_sensor.h similarity index 100% rename from src/light/light_sensor.h rename to src/plugins/light/light_sensor.h diff --git a/src/light/light_sensor_hal.cpp b/src/plugins/light/light_sensor_hal.cpp similarity index 100% rename from src/light/light_sensor_hal.cpp rename to src/plugins/light/light_sensor_hal.cpp diff --git a/src/light/light_sensor_hal.h b/src/plugins/light/light_sensor_hal.h similarity index 100% rename from src/light/light_sensor_hal.h rename to src/plugins/light/light_sensor_hal.h diff --git a/src/linear_accel/CMakeLists.txt b/src/plugins/linear_accel/CMakeLists.txt similarity index 90% rename from src/linear_accel/CMakeLists.txt rename to src/plugins/linear_accel/CMakeLists.txt index fbc726f..c819bf7 100755 --- a/src/linear_accel/CMakeLists.txt +++ b/src/plugins/linear_accel/CMakeLists.txt @@ -5,7 +5,7 @@ SET(SENSOR_NAME linear_accel_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) -include_directories(${CMAKE_SOURCE_DIR}/src/sensor_fusion) +include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) FOREACH(flag ${linear_accel_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/linear_accel/linear_accel_sensor.cpp b/src/plugins/linear_accel/linear_accel_sensor.cpp similarity index 100% rename from src/linear_accel/linear_accel_sensor.cpp rename to src/plugins/linear_accel/linear_accel_sensor.cpp diff --git a/src/linear_accel/linear_accel_sensor.h b/src/plugins/linear_accel/linear_accel_sensor.h similarity index 100% rename from src/linear_accel/linear_accel_sensor.h rename to src/plugins/linear_accel/linear_accel_sensor.h diff --git a/src/orientation/CMakeLists.txt b/src/plugins/orientation/CMakeLists.txt similarity index 90% rename from src/orientation/CMakeLists.txt rename to src/plugins/orientation/CMakeLists.txt index 5418674..455f0f4 100755 --- a/src/orientation/CMakeLists.txt +++ b/src/plugins/orientation/CMakeLists.txt @@ -5,7 +5,7 @@ SET(SENSOR_NAME orientation_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) -include_directories(${CMAKE_SOURCE_DIR}/src/sensor_fusion) +include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) FOREACH(flag ${orientation_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/orientation/orientation_sensor.cpp b/src/plugins/orientation/orientation_sensor.cpp similarity index 100% rename from src/orientation/orientation_sensor.cpp rename to src/plugins/orientation/orientation_sensor.cpp diff --git a/src/orientation/orientation_sensor.h b/src/plugins/orientation/orientation_sensor.h similarity index 100% rename from src/orientation/orientation_sensor.h rename to src/plugins/orientation/orientation_sensor.h diff --git a/src/pressure/CMakeLists.txt b/src/plugins/pressure/CMakeLists.txt similarity index 100% rename from src/pressure/CMakeLists.txt rename to src/plugins/pressure/CMakeLists.txt diff --git a/src/pressure/pressure_sensor.cpp b/src/plugins/pressure/pressure_sensor.cpp similarity index 100% rename from src/pressure/pressure_sensor.cpp rename to src/plugins/pressure/pressure_sensor.cpp diff --git a/src/pressure/pressure_sensor.h b/src/plugins/pressure/pressure_sensor.h similarity index 100% rename from src/pressure/pressure_sensor.h rename to src/plugins/pressure/pressure_sensor.h diff --git a/src/pressure/pressure_sensor_hal.cpp b/src/plugins/pressure/pressure_sensor_hal.cpp similarity index 100% rename from src/pressure/pressure_sensor_hal.cpp rename to src/plugins/pressure/pressure_sensor_hal.cpp diff --git a/src/pressure/pressure_sensor_hal.h b/src/plugins/pressure/pressure_sensor_hal.h similarity index 100% rename from src/pressure/pressure_sensor_hal.h rename to src/plugins/pressure/pressure_sensor_hal.h diff --git a/src/proxi/CMakeLists.txt b/src/plugins/proxi/CMakeLists.txt similarity index 100% rename from src/proxi/CMakeLists.txt rename to src/plugins/proxi/CMakeLists.txt diff --git a/src/proxi/proxi_sensor.cpp b/src/plugins/proxi/proxi_sensor.cpp similarity index 100% rename from src/proxi/proxi_sensor.cpp rename to src/plugins/proxi/proxi_sensor.cpp diff --git a/src/proxi/proxi_sensor.h b/src/plugins/proxi/proxi_sensor.h similarity index 100% rename from src/proxi/proxi_sensor.h rename to src/plugins/proxi/proxi_sensor.h diff --git a/src/proxi/proxi_sensor_hal.cpp b/src/plugins/proxi/proxi_sensor_hal.cpp similarity index 100% rename from src/proxi/proxi_sensor_hal.cpp rename to src/plugins/proxi/proxi_sensor_hal.cpp diff --git a/src/proxi/proxi_sensor_hal.h b/src/plugins/proxi/proxi_sensor_hal.h similarity index 100% rename from src/proxi/proxi_sensor_hal.h rename to src/plugins/proxi/proxi_sensor_hal.h diff --git a/src/rotation_vector/CMakeLists.txt b/src/plugins/rotation_vector/CMakeLists.txt similarity index 100% rename from src/rotation_vector/CMakeLists.txt rename to src/plugins/rotation_vector/CMakeLists.txt diff --git a/src/rotation_vector/gaming_rv/CMakeLists.txt b/src/plugins/rotation_vector/gaming_rv/CMakeLists.txt similarity index 90% rename from src/rotation_vector/gaming_rv/CMakeLists.txt rename to src/plugins/rotation_vector/gaming_rv/CMakeLists.txt index a56dc73..2d13a9f 100755 --- a/src/rotation_vector/gaming_rv/CMakeLists.txt +++ b/src/plugins/rotation_vector/gaming_rv/CMakeLists.txt @@ -5,7 +5,7 @@ SET(SENSOR_NAME gaming_rv_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) -include_directories(${CMAKE_SOURCE_DIR}/src/sensor_fusion) +include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) FOREACH(flag ${gaming_rv_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/rotation_vector/gaming_rv/gaming_rv_sensor.cpp b/src/plugins/rotation_vector/gaming_rv/gaming_rv_sensor.cpp similarity index 100% rename from src/rotation_vector/gaming_rv/gaming_rv_sensor.cpp rename to src/plugins/rotation_vector/gaming_rv/gaming_rv_sensor.cpp diff --git a/src/rotation_vector/gaming_rv/gaming_rv_sensor.h b/src/plugins/rotation_vector/gaming_rv/gaming_rv_sensor.h similarity index 100% rename from src/rotation_vector/gaming_rv/gaming_rv_sensor.h rename to src/plugins/rotation_vector/gaming_rv/gaming_rv_sensor.h diff --git a/src/rotation_vector/geomagnetic_rv/CMakeLists.txt b/src/plugins/rotation_vector/geomagnetic_rv/CMakeLists.txt similarity index 90% rename from src/rotation_vector/geomagnetic_rv/CMakeLists.txt rename to src/plugins/rotation_vector/geomagnetic_rv/CMakeLists.txt index 6b44750..56bd3c1 100755 --- a/src/rotation_vector/geomagnetic_rv/CMakeLists.txt +++ b/src/plugins/rotation_vector/geomagnetic_rv/CMakeLists.txt @@ -5,7 +5,7 @@ SET(SENSOR_NAME geomagnetic_rv_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) -include_directories(${CMAKE_SOURCE_DIR}/src/sensor_fusion) +include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) FOREACH(flag ${geomagnetic_rv_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp b/src/plugins/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp similarity index 100% rename from src/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp rename to src/plugins/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp diff --git a/src/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.h b/src/plugins/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.h similarity index 100% rename from src/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.h rename to src/plugins/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.h diff --git a/src/rotation_vector/rv/CMakeLists.txt b/src/plugins/rotation_vector/rv/CMakeLists.txt similarity index 89% rename from src/rotation_vector/rv/CMakeLists.txt rename to src/plugins/rotation_vector/rv/CMakeLists.txt index 1549c6f..4cbb90f 100755 --- a/src/rotation_vector/rv/CMakeLists.txt +++ b/src/plugins/rotation_vector/rv/CMakeLists.txt @@ -5,7 +5,7 @@ SET(SENSOR_NAME rv_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) -include_directories(${CMAKE_SOURCE_DIR}/src/sensor_fusion) +include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) FOREACH(flag ${rv_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/rotation_vector/rv/rv_sensor.cpp b/src/plugins/rotation_vector/rv/rv_sensor.cpp similarity index 100% rename from src/rotation_vector/rv/rv_sensor.cpp rename to src/plugins/rotation_vector/rv/rv_sensor.cpp diff --git a/src/rotation_vector/rv/rv_sensor.h b/src/plugins/rotation_vector/rv/rv_sensor.h similarity index 100% rename from src/rotation_vector/rv/rv_sensor.h rename to src/plugins/rotation_vector/rv/rv_sensor.h diff --git a/src/rotation_vector/rv_raw/CMakeLists.txt b/src/plugins/rotation_vector/rv_raw/CMakeLists.txt similarity index 100% rename from src/rotation_vector/rv_raw/CMakeLists.txt rename to src/plugins/rotation_vector/rv_raw/CMakeLists.txt diff --git a/src/rotation_vector/rv_raw/rv_raw_sensor.cpp b/src/plugins/rotation_vector/rv_raw/rv_raw_sensor.cpp similarity index 100% rename from src/rotation_vector/rv_raw/rv_raw_sensor.cpp rename to src/plugins/rotation_vector/rv_raw/rv_raw_sensor.cpp diff --git a/src/rotation_vector/rv_raw/rv_raw_sensor.h b/src/plugins/rotation_vector/rv_raw/rv_raw_sensor.h similarity index 100% rename from src/rotation_vector/rv_raw/rv_raw_sensor.h rename to src/plugins/rotation_vector/rv_raw/rv_raw_sensor.h diff --git a/src/rotation_vector/rv_raw/rv_raw_sensor_hal.cpp b/src/plugins/rotation_vector/rv_raw/rv_raw_sensor_hal.cpp similarity index 100% rename from src/rotation_vector/rv_raw/rv_raw_sensor_hal.cpp rename to src/plugins/rotation_vector/rv_raw/rv_raw_sensor_hal.cpp diff --git a/src/rotation_vector/rv_raw/rv_raw_sensor_hal.h b/src/plugins/rotation_vector/rv_raw/rv_raw_sensor_hal.h similarity index 100% rename from src/rotation_vector/rv_raw/rv_raw_sensor_hal.h rename to src/plugins/rotation_vector/rv_raw/rv_raw_sensor_hal.h diff --git a/src/sensor_fusion/CMakeLists.txt b/src/plugins/sensor_fusion/CMakeLists.txt similarity index 100% rename from src/sensor_fusion/CMakeLists.txt rename to src/plugins/sensor_fusion/CMakeLists.txt diff --git a/src/sensor_fusion/design/data/100ms/gravity/single_roll_throw/accel.txt b/src/plugins/sensor_fusion/design/data/100ms/gravity/single_roll_throw/accel.txt similarity index 100% rename from src/sensor_fusion/design/data/100ms/gravity/single_roll_throw/accel.txt rename to src/plugins/sensor_fusion/design/data/100ms/gravity/single_roll_throw/accel.txt diff --git a/src/sensor_fusion/design/data/100ms/gravity/single_roll_throw/gyro.txt b/src/plugins/sensor_fusion/design/data/100ms/gravity/single_roll_throw/gyro.txt similarity index 100% rename from src/sensor_fusion/design/data/100ms/gravity/single_roll_throw/gyro.txt rename to src/plugins/sensor_fusion/design/data/100ms/gravity/single_roll_throw/gyro.txt diff --git a/src/sensor_fusion/design/data/100ms/gravity/single_roll_throw/magnetic.txt b/src/plugins/sensor_fusion/design/data/100ms/gravity/single_roll_throw/magnetic.txt similarity index 100% rename from src/sensor_fusion/design/data/100ms/gravity/single_roll_throw/magnetic.txt rename to src/plugins/sensor_fusion/design/data/100ms/gravity/single_roll_throw/magnetic.txt diff --git a/src/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/accel.txt b/src/plugins/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/accel.txt similarity index 100% rename from src/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/accel.txt rename to src/plugins/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/accel.txt diff --git a/src/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/gyro.txt b/src/plugins/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/gyro.txt similarity index 100% rename from src/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/gyro.txt rename to src/plugins/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/gyro.txt diff --git a/src/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/magnetic.txt b/src/plugins/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/magnetic.txt similarity index 100% rename from src/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/magnetic.txt rename to src/plugins/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/magnetic.txt diff --git a/src/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/accel.txt b/src/plugins/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/accel.txt similarity index 100% rename from src/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/accel.txt rename to src/plugins/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/accel.txt diff --git a/src/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/gyro.txt b/src/plugins/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/gyro.txt similarity index 100% rename from src/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/gyro.txt rename to src/plugins/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/gyro.txt diff --git a/src/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/magnetic.txt b/src/plugins/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/magnetic.txt similarity index 100% rename from src/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/magnetic.txt rename to src/plugins/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/magnetic.txt diff --git a/src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/accel b/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/accel similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/accel rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/accel diff --git a/src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/gyro b/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/gyro similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/gyro rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/gyro diff --git a/src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/magnetic b/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/magnetic similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/magnetic rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/magnetic diff --git a/src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/accel b/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/accel similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/accel rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/accel diff --git a/src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/gyro b/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/gyro similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/gyro rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/gyro diff --git a/src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/magnetic b/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/magnetic similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/magnetic rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/magnetic diff --git a/src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/accel b/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/accel similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/accel rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/accel diff --git a/src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/gyro b/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/gyro similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/gyro rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/gyro diff --git a/src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/magnetic b/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/magnetic similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/magnetic rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/magnetic diff --git a/src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/accel b/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/accel similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/accel rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/accel diff --git a/src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/gyro b/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/gyro similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/gyro rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/gyro diff --git a/src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/magnetic b/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/magnetic similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/magnetic rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/magnetic diff --git a/src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/accel b/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/accel similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/accel rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/accel diff --git a/src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/gyro b/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/gyro similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/gyro rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/gyro diff --git a/src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/magnetic b/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/magnetic similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/magnetic rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/magnetic diff --git a/src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/accel b/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/accel similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/accel rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/accel diff --git a/src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/gyro b/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/gyro similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/gyro rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/gyro diff --git a/src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/magnetic b/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/magnetic similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/magnetic rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/magnetic diff --git a/src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/accel b/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/accel similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/accel rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/accel diff --git a/src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/gyro b/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/gyro similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/gyro rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/gyro diff --git a/src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/magnetic b/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/magnetic similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/magnetic rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/magnetic diff --git a/src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/accel b/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/accel similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/accel rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/accel diff --git a/src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/gyro b/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/gyro similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/gyro rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/gyro diff --git a/src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/magnetic b/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/magnetic similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/magnetic rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/magnetic diff --git a/src/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/accel b/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/accel similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/accel rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/accel diff --git a/src/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/gyro b/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/gyro similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/gyro rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/gyro diff --git a/src/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/magnetic b/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/magnetic similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/magnetic rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/magnetic diff --git a/src/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/accel b/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/accel similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/accel rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/accel diff --git a/src/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/gyro b/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/gyro similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/gyro rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/gyro diff --git a/src/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/magnetic b/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/magnetic similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/magnetic rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/magnetic diff --git a/src/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/accel b/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/accel similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/accel rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/accel diff --git a/src/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/gyro b/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/gyro similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/gyro rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/gyro diff --git a/src/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/magnetic b/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/magnetic similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/magnetic rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/magnetic diff --git a/src/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/accel b/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/accel similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/accel rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/accel diff --git a/src/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/gyro b/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/gyro similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/gyro rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/gyro diff --git a/src/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/magnetic b/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/magnetic similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/magnetic rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/magnetic diff --git a/src/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/accel b/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/accel similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/accel rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/accel diff --git a/src/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/gyro b/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/gyro similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/gyro rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/gyro diff --git a/src/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/magnetic b/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/magnetic similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/magnetic rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/magnetic diff --git a/src/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/accel b/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/accel similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/accel rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/accel diff --git a/src/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/gyro b/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/gyro similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/gyro rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/gyro diff --git a/src/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/magnetic b/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/magnetic similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/magnetic rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/magnetic diff --git a/src/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/accel b/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/accel similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/accel rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/accel diff --git a/src/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/gyro b/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/gyro similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/gyro rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/gyro diff --git a/src/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/magnetic b/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/magnetic similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/magnetic rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/magnetic diff --git a/src/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/accel b/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/accel similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/accel rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/accel diff --git a/src/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/gyro b/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/gyro similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/gyro rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/gyro diff --git a/src/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/magnetic b/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/magnetic similarity index 100% rename from src/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/magnetic rename to src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/magnetic diff --git a/src/sensor_fusion/design/documentation/diagram/block_diagram_gravity_and_linear_acceleration.png b/src/plugins/sensor_fusion/design/documentation/diagram/block_diagram_gravity_and_linear_acceleration.png similarity index 100% rename from src/sensor_fusion/design/documentation/diagram/block_diagram_gravity_and_linear_acceleration.png rename to src/plugins/sensor_fusion/design/documentation/diagram/block_diagram_gravity_and_linear_acceleration.png diff --git a/src/sensor_fusion/design/documentation/diagram/block_diagram_orientation_estimation.png b/src/plugins/sensor_fusion/design/documentation/diagram/block_diagram_orientation_estimation.png similarity index 100% rename from src/sensor_fusion/design/documentation/diagram/block_diagram_orientation_estimation.png rename to src/plugins/sensor_fusion/design/documentation/diagram/block_diagram_orientation_estimation.png diff --git a/src/sensor_fusion/design/documentation/diagram/device_orientation.png b/src/plugins/sensor_fusion/design/documentation/diagram/device_orientation.png similarity index 100% rename from src/sensor_fusion/design/documentation/diagram/device_orientation.png rename to src/plugins/sensor_fusion/design/documentation/diagram/device_orientation.png diff --git a/src/sensor_fusion/design/documentation/diagram/kalman_filter_stages.png b/src/plugins/sensor_fusion/design/documentation/diagram/kalman_filter_stages.png similarity index 100% rename from src/sensor_fusion/design/documentation/diagram/kalman_filter_stages.png rename to src/plugins/sensor_fusion/design/documentation/diagram/kalman_filter_stages.png diff --git a/src/sensor_fusion/design/documentation/diagram/orientation_effect_on_gravity.png b/src/plugins/sensor_fusion/design/documentation/diagram/orientation_effect_on_gravity.png similarity index 100% rename from src/sensor_fusion/design/documentation/diagram/orientation_effect_on_gravity.png rename to src/plugins/sensor_fusion/design/documentation/diagram/orientation_effect_on_gravity.png diff --git a/src/sensor_fusion/design/documentation/diagram/projection_diagram_gravity_computation.png b/src/plugins/sensor_fusion/design/documentation/diagram/projection_diagram_gravity_computation.png similarity index 100% rename from src/sensor_fusion/design/documentation/diagram/projection_diagram_gravity_computation.png rename to src/plugins/sensor_fusion/design/documentation/diagram/projection_diagram_gravity_computation.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_1.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_1.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_1.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_1.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_10.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_10.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_10.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_10.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_11.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_11.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_11.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_11.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_12.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_12.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_12.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_12.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_13.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_13.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_13.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_13.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_13_updated.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_13_updated.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_13_updated.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_13_updated.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_14.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_14.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_14.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_14.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_15.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_15.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_15.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_15.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_16.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_16.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_16.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_16.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_17.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_17.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_17.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_17.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_18.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_18.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_18.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_18.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_19.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_19.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_19.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_19.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_2.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_2.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_2.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_2.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_20.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_20.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_20.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_20.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_21.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_21.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_21.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_21.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_22.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_22.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_22.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_22.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_23.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_23.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_23.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_23.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_24.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_24.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_24.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_24.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_25.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_25.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_25.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_25.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_26.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_26.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_26.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_26.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_27.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_27.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_27.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_27.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_28.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_28.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_28.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_28.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_29.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_29.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_29.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_29.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_3.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_3.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_3.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_3.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_30.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_30.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_30.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_30.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_31.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_31.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_31.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_31.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_32.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_32.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_32.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_32.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_33.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_33.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_33.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_33.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_34.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_34.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_34.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_34.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_35.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_35.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_35.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_35.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_36.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_36.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_36.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_36.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_37.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_37.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_37.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_37.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_38.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_38.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_38.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_38.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_39.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_39.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_39.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_39.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_4.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_4.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_4.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_4.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_40.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_40.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_40.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_40.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_5.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_5.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_5.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_5.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_6.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_6.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_6.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_6.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_7.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_7.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_7.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_7.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_8.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_8.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_8.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_8.png diff --git a/src/sensor_fusion/design/documentation/equation/equation_9.png b/src/plugins/sensor_fusion/design/documentation/equation/equation_9.png similarity index 100% rename from src/sensor_fusion/design/documentation/equation/equation_9.png rename to src/plugins/sensor_fusion/design/documentation/equation/equation_9.png diff --git a/src/sensor_fusion/design/documentation/sensor_fusion.htm b/src/plugins/sensor_fusion/design/documentation/sensor_fusion.htm similarity index 100% rename from src/sensor_fusion/design/documentation/sensor_fusion.htm rename to src/plugins/sensor_fusion/design/documentation/sensor_fusion.htm diff --git a/src/sensor_fusion/design/lib/axis_rot2quat.m b/src/plugins/sensor_fusion/design/lib/axis_rot2quat.m similarity index 100% rename from src/sensor_fusion/design/lib/axis_rot2quat.m rename to src/plugins/sensor_fusion/design/lib/axis_rot2quat.m diff --git a/src/sensor_fusion/design/lib/estimate_gaming_rv.m b/src/plugins/sensor_fusion/design/lib/estimate_gaming_rv.m similarity index 100% rename from src/sensor_fusion/design/lib/estimate_gaming_rv.m rename to src/plugins/sensor_fusion/design/lib/estimate_gaming_rv.m diff --git a/src/sensor_fusion/design/lib/estimate_geomagnetic_rv.m b/src/plugins/sensor_fusion/design/lib/estimate_geomagnetic_rv.m similarity index 100% rename from src/sensor_fusion/design/lib/estimate_geomagnetic_rv.m rename to src/plugins/sensor_fusion/design/lib/estimate_geomagnetic_rv.m diff --git a/src/sensor_fusion/design/lib/estimate_gravity.m b/src/plugins/sensor_fusion/design/lib/estimate_gravity.m similarity index 100% rename from src/sensor_fusion/design/lib/estimate_gravity.m rename to src/plugins/sensor_fusion/design/lib/estimate_gravity.m diff --git a/src/sensor_fusion/design/lib/estimate_linear_acceleration.m b/src/plugins/sensor_fusion/design/lib/estimate_linear_acceleration.m similarity index 100% rename from src/sensor_fusion/design/lib/estimate_linear_acceleration.m rename to src/plugins/sensor_fusion/design/lib/estimate_linear_acceleration.m diff --git a/src/sensor_fusion/design/lib/estimate_orientation.m b/src/plugins/sensor_fusion/design/lib/estimate_orientation.m similarity index 100% rename from src/sensor_fusion/design/lib/estimate_orientation.m rename to src/plugins/sensor_fusion/design/lib/estimate_orientation.m diff --git a/src/sensor_fusion/design/lib/euler2quat.m b/src/plugins/sensor_fusion/design/lib/euler2quat.m similarity index 100% rename from src/sensor_fusion/design/lib/euler2quat.m rename to src/plugins/sensor_fusion/design/lib/euler2quat.m diff --git a/src/sensor_fusion/design/lib/quat2euler.m b/src/plugins/sensor_fusion/design/lib/quat2euler.m similarity index 100% rename from src/sensor_fusion/design/lib/quat2euler.m rename to src/plugins/sensor_fusion/design/lib/quat2euler.m diff --git a/src/sensor_fusion/design/lib/quat2rot_mat.m b/src/plugins/sensor_fusion/design/lib/quat2rot_mat.m similarity index 100% rename from src/sensor_fusion/design/lib/quat2rot_mat.m rename to src/plugins/sensor_fusion/design/lib/quat2rot_mat.m diff --git a/src/sensor_fusion/design/lib/quat_prod.m b/src/plugins/sensor_fusion/design/lib/quat_prod.m similarity index 100% rename from src/sensor_fusion/design/lib/quat_prod.m rename to src/plugins/sensor_fusion/design/lib/quat_prod.m diff --git a/src/sensor_fusion/design/lib/rot_mat2quat.m b/src/plugins/sensor_fusion/design/lib/rot_mat2quat.m similarity index 100% rename from src/sensor_fusion/design/lib/rot_mat2quat.m rename to src/plugins/sensor_fusion/design/lib/rot_mat2quat.m diff --git a/src/sensor_fusion/design/lib/sf_pedometer.m b/src/plugins/sensor_fusion/design/lib/sf_pedometer.m similarity index 100% rename from src/sensor_fusion/design/lib/sf_pedometer.m rename to src/plugins/sensor_fusion/design/lib/sf_pedometer.m diff --git a/src/sensor_fusion/design/readme b/src/plugins/sensor_fusion/design/readme similarity index 100% rename from src/sensor_fusion/design/readme rename to src/plugins/sensor_fusion/design/readme diff --git a/src/sensor_fusion/design/sf_gaming_rv.m b/src/plugins/sensor_fusion/design/sf_gaming_rv.m similarity index 100% rename from src/sensor_fusion/design/sf_gaming_rv.m rename to src/plugins/sensor_fusion/design/sf_gaming_rv.m diff --git a/src/sensor_fusion/design/sf_geomagnetic_rv.m b/src/plugins/sensor_fusion/design/sf_geomagnetic_rv.m similarity index 100% rename from src/sensor_fusion/design/sf_geomagnetic_rv.m rename to src/plugins/sensor_fusion/design/sf_geomagnetic_rv.m diff --git a/src/sensor_fusion/design/sf_gravity.m b/src/plugins/sensor_fusion/design/sf_gravity.m similarity index 100% rename from src/sensor_fusion/design/sf_gravity.m rename to src/plugins/sensor_fusion/design/sf_gravity.m diff --git a/src/sensor_fusion/design/sf_linear_acceleration.m b/src/plugins/sensor_fusion/design/sf_linear_acceleration.m similarity index 100% rename from src/sensor_fusion/design/sf_linear_acceleration.m rename to src/plugins/sensor_fusion/design/sf_linear_acceleration.m diff --git a/src/sensor_fusion/design/sf_orientation.m b/src/plugins/sensor_fusion/design/sf_orientation.m similarity index 100% rename from src/sensor_fusion/design/sf_orientation.m rename to src/plugins/sensor_fusion/design/sf_orientation.m diff --git a/src/sensor_fusion/euler_angles.cpp b/src/plugins/sensor_fusion/euler_angles.cpp similarity index 100% rename from src/sensor_fusion/euler_angles.cpp rename to src/plugins/sensor_fusion/euler_angles.cpp diff --git a/src/sensor_fusion/euler_angles.h b/src/plugins/sensor_fusion/euler_angles.h similarity index 100% rename from src/sensor_fusion/euler_angles.h rename to src/plugins/sensor_fusion/euler_angles.h diff --git a/src/sensor_fusion/matrix.cpp b/src/plugins/sensor_fusion/matrix.cpp similarity index 100% rename from src/sensor_fusion/matrix.cpp rename to src/plugins/sensor_fusion/matrix.cpp diff --git a/src/sensor_fusion/matrix.h b/src/plugins/sensor_fusion/matrix.h similarity index 100% rename from src/sensor_fusion/matrix.h rename to src/plugins/sensor_fusion/matrix.h diff --git a/src/sensor_fusion/orientation_filter.cpp b/src/plugins/sensor_fusion/orientation_filter.cpp similarity index 100% rename from src/sensor_fusion/orientation_filter.cpp rename to src/plugins/sensor_fusion/orientation_filter.cpp diff --git a/src/sensor_fusion/orientation_filter.h b/src/plugins/sensor_fusion/orientation_filter.h similarity index 100% rename from src/sensor_fusion/orientation_filter.h rename to src/plugins/sensor_fusion/orientation_filter.h diff --git a/src/sensor_fusion/quaternion.cpp b/src/plugins/sensor_fusion/quaternion.cpp similarity index 100% rename from src/sensor_fusion/quaternion.cpp rename to src/plugins/sensor_fusion/quaternion.cpp diff --git a/src/sensor_fusion/quaternion.h b/src/plugins/sensor_fusion/quaternion.h similarity index 100% rename from src/sensor_fusion/quaternion.h rename to src/plugins/sensor_fusion/quaternion.h diff --git a/src/sensor_fusion/rotation_matrix.cpp b/src/plugins/sensor_fusion/rotation_matrix.cpp similarity index 100% rename from src/sensor_fusion/rotation_matrix.cpp rename to src/plugins/sensor_fusion/rotation_matrix.cpp diff --git a/src/sensor_fusion/rotation_matrix.h b/src/plugins/sensor_fusion/rotation_matrix.h similarity index 100% rename from src/sensor_fusion/rotation_matrix.h rename to src/plugins/sensor_fusion/rotation_matrix.h diff --git a/src/sensor_fusion/sensor_data.cpp b/src/plugins/sensor_fusion/sensor_data.cpp similarity index 100% rename from src/sensor_fusion/sensor_data.cpp rename to src/plugins/sensor_fusion/sensor_data.cpp diff --git a/src/sensor_fusion/sensor_data.h b/src/plugins/sensor_fusion/sensor_data.h similarity index 100% rename from src/sensor_fusion/sensor_data.h rename to src/plugins/sensor_fusion/sensor_data.h diff --git a/src/sensor_fusion/test/gravity_sensor.cpp b/src/plugins/sensor_fusion/test/gravity_sensor.cpp similarity index 100% rename from src/sensor_fusion/test/gravity_sensor.cpp rename to src/plugins/sensor_fusion/test/gravity_sensor.cpp diff --git a/src/sensor_fusion/test/gravity_sensor.h b/src/plugins/sensor_fusion/test/gravity_sensor.h similarity index 100% rename from src/sensor_fusion/test/gravity_sensor.h rename to src/plugins/sensor_fusion/test/gravity_sensor.h diff --git a/src/sensor_fusion/test/linear_acceleration_sensor.cpp b/src/plugins/sensor_fusion/test/linear_acceleration_sensor.cpp similarity index 100% rename from src/sensor_fusion/test/linear_acceleration_sensor.cpp rename to src/plugins/sensor_fusion/test/linear_acceleration_sensor.cpp diff --git a/src/sensor_fusion/test/linear_acceleration_sensor.h b/src/plugins/sensor_fusion/test/linear_acceleration_sensor.h similarity index 100% rename from src/sensor_fusion/test/linear_acceleration_sensor.h rename to src/plugins/sensor_fusion/test/linear_acceleration_sensor.h diff --git a/src/sensor_fusion/test/orientation_sensor.cpp b/src/plugins/sensor_fusion/test/orientation_sensor.cpp similarity index 100% rename from src/sensor_fusion/test/orientation_sensor.cpp rename to src/plugins/sensor_fusion/test/orientation_sensor.cpp diff --git a/src/sensor_fusion/test/orientation_sensor.h b/src/plugins/sensor_fusion/test/orientation_sensor.h similarity index 100% rename from src/sensor_fusion/test/orientation_sensor.h rename to src/plugins/sensor_fusion/test/orientation_sensor.h diff --git a/src/sensor_fusion/test/test_projects/euler_angles_test/.cproject b/src/plugins/sensor_fusion/test/test_projects/euler_angles_test/.cproject similarity index 100% rename from src/sensor_fusion/test/test_projects/euler_angles_test/.cproject rename to src/plugins/sensor_fusion/test/test_projects/euler_angles_test/.cproject diff --git a/src/sensor_fusion/test/test_projects/euler_angles_test/.project b/src/plugins/sensor_fusion/test/test_projects/euler_angles_test/.project similarity index 100% rename from src/sensor_fusion/test/test_projects/euler_angles_test/.project rename to src/plugins/sensor_fusion/test/test_projects/euler_angles_test/.project diff --git a/src/sensor_fusion/test/test_projects/euler_angles_test/euler_angles_main.cpp b/src/plugins/sensor_fusion/test/test_projects/euler_angles_test/euler_angles_main.cpp similarity index 100% rename from src/sensor_fusion/test/test_projects/euler_angles_test/euler_angles_main.cpp rename to src/plugins/sensor_fusion/test/test_projects/euler_angles_test/euler_angles_main.cpp diff --git a/src/sensor_fusion/test/test_projects/gravity_sensor_test/.cproject b/src/plugins/sensor_fusion/test/test_projects/gravity_sensor_test/.cproject similarity index 100% rename from src/sensor_fusion/test/test_projects/gravity_sensor_test/.cproject rename to src/plugins/sensor_fusion/test/test_projects/gravity_sensor_test/.cproject diff --git a/src/sensor_fusion/test/test_projects/gravity_sensor_test/.project b/src/plugins/sensor_fusion/test/test_projects/gravity_sensor_test/.project similarity index 100% rename from src/sensor_fusion/test/test_projects/gravity_sensor_test/.project rename to src/plugins/sensor_fusion/test/test_projects/gravity_sensor_test/.project diff --git a/src/sensor_fusion/test/test_projects/gravity_sensor_test/gravity_sensor_main.cpp b/src/plugins/sensor_fusion/test/test_projects/gravity_sensor_test/gravity_sensor_main.cpp similarity index 100% rename from src/sensor_fusion/test/test_projects/gravity_sensor_test/gravity_sensor_main.cpp rename to src/plugins/sensor_fusion/test/test_projects/gravity_sensor_test/gravity_sensor_main.cpp diff --git a/src/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.cproject b/src/plugins/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.cproject similarity index 100% rename from src/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.cproject rename to src/plugins/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.cproject diff --git a/src/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.project b/src/plugins/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.project similarity index 100% rename from src/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.project rename to src/plugins/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.project diff --git a/src/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/linear_acceleration_sensor_main.cpp b/src/plugins/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/linear_acceleration_sensor_main.cpp similarity index 100% rename from src/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/linear_acceleration_sensor_main.cpp rename to src/plugins/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/linear_acceleration_sensor_main.cpp diff --git a/src/sensor_fusion/test/test_projects/matrix_test/.cproject b/src/plugins/sensor_fusion/test/test_projects/matrix_test/.cproject similarity index 100% rename from src/sensor_fusion/test/test_projects/matrix_test/.cproject rename to src/plugins/sensor_fusion/test/test_projects/matrix_test/.cproject diff --git a/src/sensor_fusion/test/test_projects/matrix_test/.project b/src/plugins/sensor_fusion/test/test_projects/matrix_test/.project similarity index 100% rename from src/sensor_fusion/test/test_projects/matrix_test/.project rename to src/plugins/sensor_fusion/test/test_projects/matrix_test/.project diff --git a/src/sensor_fusion/test/test_projects/matrix_test/matrix_main.cpp b/src/plugins/sensor_fusion/test/test_projects/matrix_test/matrix_main.cpp similarity index 100% rename from src/sensor_fusion/test/test_projects/matrix_test/matrix_main.cpp rename to src/plugins/sensor_fusion/test/test_projects/matrix_test/matrix_main.cpp diff --git a/src/sensor_fusion/test/test_projects/orientation_sensor_test/.cproject b/src/plugins/sensor_fusion/test/test_projects/orientation_sensor_test/.cproject similarity index 100% rename from src/sensor_fusion/test/test_projects/orientation_sensor_test/.cproject rename to src/plugins/sensor_fusion/test/test_projects/orientation_sensor_test/.cproject diff --git a/src/sensor_fusion/test/test_projects/orientation_sensor_test/.project b/src/plugins/sensor_fusion/test/test_projects/orientation_sensor_test/.project similarity index 100% rename from src/sensor_fusion/test/test_projects/orientation_sensor_test/.project rename to src/plugins/sensor_fusion/test/test_projects/orientation_sensor_test/.project diff --git a/src/sensor_fusion/test/test_projects/orientation_sensor_test/orientation_sensor_main.cpp b/src/plugins/sensor_fusion/test/test_projects/orientation_sensor_test/orientation_sensor_main.cpp similarity index 100% rename from src/sensor_fusion/test/test_projects/orientation_sensor_test/orientation_sensor_main.cpp rename to src/plugins/sensor_fusion/test/test_projects/orientation_sensor_test/orientation_sensor_main.cpp diff --git a/src/sensor_fusion/test/test_projects/quaternion_test/.cproject b/src/plugins/sensor_fusion/test/test_projects/quaternion_test/.cproject similarity index 100% rename from src/sensor_fusion/test/test_projects/quaternion_test/.cproject rename to src/plugins/sensor_fusion/test/test_projects/quaternion_test/.cproject diff --git a/src/sensor_fusion/test/test_projects/quaternion_test/.project b/src/plugins/sensor_fusion/test/test_projects/quaternion_test/.project similarity index 100% rename from src/sensor_fusion/test/test_projects/quaternion_test/.project rename to src/plugins/sensor_fusion/test/test_projects/quaternion_test/.project diff --git a/src/sensor_fusion/test/test_projects/quaternion_test/quaternion_main.cpp b/src/plugins/sensor_fusion/test/test_projects/quaternion_test/quaternion_main.cpp similarity index 100% rename from src/sensor_fusion/test/test_projects/quaternion_test/quaternion_main.cpp rename to src/plugins/sensor_fusion/test/test_projects/quaternion_test/quaternion_main.cpp diff --git a/src/sensor_fusion/test/test_projects/rotation_matrix_test/.cproject b/src/plugins/sensor_fusion/test/test_projects/rotation_matrix_test/.cproject similarity index 100% rename from src/sensor_fusion/test/test_projects/rotation_matrix_test/.cproject rename to src/plugins/sensor_fusion/test/test_projects/rotation_matrix_test/.cproject diff --git a/src/sensor_fusion/test/test_projects/rotation_matrix_test/.project b/src/plugins/sensor_fusion/test/test_projects/rotation_matrix_test/.project similarity index 100% rename from src/sensor_fusion/test/test_projects/rotation_matrix_test/.project rename to src/plugins/sensor_fusion/test/test_projects/rotation_matrix_test/.project diff --git a/src/sensor_fusion/test/test_projects/rotation_matrix_test/rotation_matrix_main.cpp b/src/plugins/sensor_fusion/test/test_projects/rotation_matrix_test/rotation_matrix_main.cpp similarity index 100% rename from src/sensor_fusion/test/test_projects/rotation_matrix_test/rotation_matrix_main.cpp rename to src/plugins/sensor_fusion/test/test_projects/rotation_matrix_test/rotation_matrix_main.cpp diff --git a/src/sensor_fusion/test/test_projects/sensor_data_test/.cproject b/src/plugins/sensor_fusion/test/test_projects/sensor_data_test/.cproject similarity index 100% rename from src/sensor_fusion/test/test_projects/sensor_data_test/.cproject rename to src/plugins/sensor_fusion/test/test_projects/sensor_data_test/.cproject diff --git a/src/sensor_fusion/test/test_projects/sensor_data_test/.project b/src/plugins/sensor_fusion/test/test_projects/sensor_data_test/.project similarity index 100% rename from src/sensor_fusion/test/test_projects/sensor_data_test/.project rename to src/plugins/sensor_fusion/test/test_projects/sensor_data_test/.project diff --git a/src/sensor_fusion/test/test_projects/sensor_data_test/sensor_data_main.cpp b/src/plugins/sensor_fusion/test/test_projects/sensor_data_test/sensor_data_main.cpp similarity index 100% rename from src/sensor_fusion/test/test_projects/sensor_data_test/sensor_data_main.cpp rename to src/plugins/sensor_fusion/test/test_projects/sensor_data_test/sensor_data_main.cpp diff --git a/src/sensor_fusion/test/test_projects/vector_test/.cproject b/src/plugins/sensor_fusion/test/test_projects/vector_test/.cproject similarity index 100% rename from src/sensor_fusion/test/test_projects/vector_test/.cproject rename to src/plugins/sensor_fusion/test/test_projects/vector_test/.cproject diff --git a/src/sensor_fusion/test/test_projects/vector_test/.project b/src/plugins/sensor_fusion/test/test_projects/vector_test/.project similarity index 100% rename from src/sensor_fusion/test/test_projects/vector_test/.project rename to src/plugins/sensor_fusion/test/test_projects/vector_test/.project diff --git a/src/sensor_fusion/test/test_projects/vector_test/vector_main.cpp b/src/plugins/sensor_fusion/test/test_projects/vector_test/vector_main.cpp similarity index 100% rename from src/sensor_fusion/test/test_projects/vector_test/vector_main.cpp rename to src/plugins/sensor_fusion/test/test_projects/vector_test/vector_main.cpp diff --git a/src/sensor_fusion/vector.cpp b/src/plugins/sensor_fusion/vector.cpp similarity index 100% rename from src/sensor_fusion/vector.cpp rename to src/plugins/sensor_fusion/vector.cpp diff --git a/src/sensor_fusion/vector.h b/src/plugins/sensor_fusion/vector.h similarity index 100% rename from src/sensor_fusion/vector.h rename to src/plugins/sensor_fusion/vector.h diff --git a/src/temperature/CMakeLists.txt b/src/plugins/temperature/CMakeLists.txt similarity index 100% rename from src/temperature/CMakeLists.txt rename to src/plugins/temperature/CMakeLists.txt diff --git a/src/temperature/temperature_sensor.cpp b/src/plugins/temperature/temperature_sensor.cpp similarity index 100% rename from src/temperature/temperature_sensor.cpp rename to src/plugins/temperature/temperature_sensor.cpp diff --git a/src/temperature/temperature_sensor.h b/src/plugins/temperature/temperature_sensor.h similarity index 100% rename from src/temperature/temperature_sensor.h rename to src/plugins/temperature/temperature_sensor.h diff --git a/src/temperature/temperature_sensor_hal.cpp b/src/plugins/temperature/temperature_sensor_hal.cpp similarity index 100% rename from src/temperature/temperature_sensor_hal.cpp rename to src/plugins/temperature/temperature_sensor_hal.cpp diff --git a/src/temperature/temperature_sensor_hal.h b/src/plugins/temperature/temperature_sensor_hal.h similarity index 100% rename from src/temperature/temperature_sensor_hal.h rename to src/plugins/temperature/temperature_sensor_hal.h diff --git a/src/tilt/CMakeLists.txt b/src/plugins/tilt/CMakeLists.txt similarity index 89% rename from src/tilt/CMakeLists.txt rename to src/plugins/tilt/CMakeLists.txt index 44e6a1a..6bd9b97 100755 --- a/src/tilt/CMakeLists.txt +++ b/src/plugins/tilt/CMakeLists.txt @@ -5,7 +5,7 @@ SET(SENSOR_NAME tilt_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) -include_directories(${CMAKE_SOURCE_DIR}/src/sensor_fusion) +include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) FOREACH(flag ${tilt_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/tilt/tilt_sensor.cpp b/src/plugins/tilt/tilt_sensor.cpp similarity index 100% rename from src/tilt/tilt_sensor.cpp rename to src/plugins/tilt/tilt_sensor.cpp diff --git a/src/tilt/tilt_sensor.h b/src/plugins/tilt/tilt_sensor.h similarity index 100% rename from src/tilt/tilt_sensor.h rename to src/plugins/tilt/tilt_sensor.h diff --git a/src/ultraviolet/CMakeLists.txt b/src/plugins/ultraviolet/CMakeLists.txt similarity index 100% rename from src/ultraviolet/CMakeLists.txt rename to src/plugins/ultraviolet/CMakeLists.txt diff --git a/src/ultraviolet/ultraviolet_sensor.cpp b/src/plugins/ultraviolet/ultraviolet_sensor.cpp similarity index 100% rename from src/ultraviolet/ultraviolet_sensor.cpp rename to src/plugins/ultraviolet/ultraviolet_sensor.cpp diff --git a/src/ultraviolet/ultraviolet_sensor.h b/src/plugins/ultraviolet/ultraviolet_sensor.h similarity index 100% rename from src/ultraviolet/ultraviolet_sensor.h rename to src/plugins/ultraviolet/ultraviolet_sensor.h diff --git a/src/ultraviolet/ultraviolet_sensor_hal.cpp b/src/plugins/ultraviolet/ultraviolet_sensor_hal.cpp similarity index 100% rename from src/ultraviolet/ultraviolet_sensor_hal.cpp rename to src/plugins/ultraviolet/ultraviolet_sensor_hal.cpp diff --git a/src/ultraviolet/ultraviolet_sensor_hal.h b/src/plugins/ultraviolet/ultraviolet_sensor_hal.h similarity index 100% rename from src/ultraviolet/ultraviolet_sensor_hal.h rename to src/plugins/ultraviolet/ultraviolet_sensor_hal.h diff --git a/src/uncal_gyro/CMakeLists.txt b/src/plugins/uncal_gyro/CMakeLists.txt similarity index 90% rename from src/uncal_gyro/CMakeLists.txt rename to src/plugins/uncal_gyro/CMakeLists.txt index 12d5b3d..056962a 100644 --- a/src/uncal_gyro/CMakeLists.txt +++ b/src/plugins/uncal_gyro/CMakeLists.txt @@ -5,7 +5,7 @@ SET(SENSOR_NAME uncal_gyro_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) -include_directories(${CMAKE_SOURCE_DIR}/src/sensor_fusion) +include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) FOREACH(flag ${gravity_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/uncal_gyro/uncal_gyro_sensor.cpp b/src/plugins/uncal_gyro/uncal_gyro_sensor.cpp similarity index 100% rename from src/uncal_gyro/uncal_gyro_sensor.cpp rename to src/plugins/uncal_gyro/uncal_gyro_sensor.cpp diff --git a/src/uncal_gyro/uncal_gyro_sensor.h b/src/plugins/uncal_gyro/uncal_gyro_sensor.h similarity index 100% rename from src/uncal_gyro/uncal_gyro_sensor.h rename to src/plugins/uncal_gyro/uncal_gyro_sensor.h diff --git a/src/shared/CMakeLists.txt b/src/shared/CMakeLists.txt index 45b6af6..91c6b32 100644 --- a/src/shared/CMakeLists.txt +++ b/src/shared/CMakeLists.txt @@ -83,4 +83,28 @@ install(FILES sensor_common.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor ) +install(FILES sensor_accel.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) +install(FILES sensor_geomag.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) +install(FILES sensor_light.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) +install(FILES sensor_proxi.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) +install(FILES sensor_gyro.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) +install(FILES sensor_pressure.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) +install(FILES sensor_context.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) +install(FILES sensor_auto_rotation.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) +install(FILES sensor_gravity.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) +install(FILES sensor_linear_accel.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) +install(FILES sensor_orientation.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) +install(FILES sensor_tilt.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) +install(FILES sensor_rv.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) +install(FILES sensor_geomagnetic_rv.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) +install(FILES sensor_gaming_rv.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) +install(FILES sensor_temperature.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) +install(FILES sensor_motion.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) +install(FILES sensor_fusion.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) +install(FILES sensor_ultraviolet.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) +install(FILES sensor_bio_led_red.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) +install(FILES sensor_deprecated.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) +install(FILES sensor_uncal_gyro.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) +install(FILES sensor_internal_deprecated.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) +install(FILES sensor_internal.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) diff --git a/src/libsensord/sensor_accel.h b/src/shared/sensor_accel.h similarity index 100% rename from src/libsensord/sensor_accel.h rename to src/shared/sensor_accel.h diff --git a/src/libsensord/sensor_auto_rotation.h b/src/shared/sensor_auto_rotation.h similarity index 100% rename from src/libsensord/sensor_auto_rotation.h rename to src/shared/sensor_auto_rotation.h diff --git a/src/libsensord/sensor_bio_led_red.h b/src/shared/sensor_bio_led_red.h similarity index 100% rename from src/libsensord/sensor_bio_led_red.h rename to src/shared/sensor_bio_led_red.h diff --git a/src/libsensord/sensor_context.h b/src/shared/sensor_context.h similarity index 100% rename from src/libsensord/sensor_context.h rename to src/shared/sensor_context.h diff --git a/src/libsensord/sensor_deprecated.h b/src/shared/sensor_deprecated.h similarity index 100% rename from src/libsensord/sensor_deprecated.h rename to src/shared/sensor_deprecated.h diff --git a/src/libsensord/sensor_fusion.h b/src/shared/sensor_fusion.h similarity index 100% rename from src/libsensord/sensor_fusion.h rename to src/shared/sensor_fusion.h diff --git a/src/libsensord/sensor_gaming_rv.h b/src/shared/sensor_gaming_rv.h similarity index 100% rename from src/libsensord/sensor_gaming_rv.h rename to src/shared/sensor_gaming_rv.h diff --git a/src/libsensord/sensor_geomag.h b/src/shared/sensor_geomag.h similarity index 100% rename from src/libsensord/sensor_geomag.h rename to src/shared/sensor_geomag.h diff --git a/src/libsensord/sensor_geomagnetic_rv.h b/src/shared/sensor_geomagnetic_rv.h similarity index 100% rename from src/libsensord/sensor_geomagnetic_rv.h rename to src/shared/sensor_geomagnetic_rv.h diff --git a/src/libsensord/sensor_gravity.h b/src/shared/sensor_gravity.h similarity index 100% rename from src/libsensord/sensor_gravity.h rename to src/shared/sensor_gravity.h diff --git a/src/libsensord/sensor_gyro.h b/src/shared/sensor_gyro.h similarity index 100% rename from src/libsensord/sensor_gyro.h rename to src/shared/sensor_gyro.h diff --git a/src/libsensord/sensor_internal.h b/src/shared/sensor_internal.h similarity index 100% rename from src/libsensord/sensor_internal.h rename to src/shared/sensor_internal.h diff --git a/src/libsensord/sensor_internal_deprecated.h b/src/shared/sensor_internal_deprecated.h similarity index 100% rename from src/libsensord/sensor_internal_deprecated.h rename to src/shared/sensor_internal_deprecated.h diff --git a/src/libsensord/sensor_light.h b/src/shared/sensor_light.h similarity index 100% rename from src/libsensord/sensor_light.h rename to src/shared/sensor_light.h diff --git a/src/libsensord/sensor_linear_accel.h b/src/shared/sensor_linear_accel.h similarity index 100% rename from src/libsensord/sensor_linear_accel.h rename to src/shared/sensor_linear_accel.h diff --git a/src/libsensord/sensor_motion.h b/src/shared/sensor_motion.h similarity index 100% rename from src/libsensord/sensor_motion.h rename to src/shared/sensor_motion.h diff --git a/src/libsensord/sensor_orientation.h b/src/shared/sensor_orientation.h similarity index 100% rename from src/libsensord/sensor_orientation.h rename to src/shared/sensor_orientation.h diff --git a/src/libsensord/sensor_pressure.h b/src/shared/sensor_pressure.h similarity index 100% rename from src/libsensord/sensor_pressure.h rename to src/shared/sensor_pressure.h diff --git a/src/libsensord/sensor_proxi.h b/src/shared/sensor_proxi.h similarity index 100% rename from src/libsensord/sensor_proxi.h rename to src/shared/sensor_proxi.h diff --git a/src/libsensord/sensor_rv.h b/src/shared/sensor_rv.h similarity index 100% rename from src/libsensord/sensor_rv.h rename to src/shared/sensor_rv.h diff --git a/src/libsensord/sensor_temperature.h b/src/shared/sensor_temperature.h similarity index 100% rename from src/libsensord/sensor_temperature.h rename to src/shared/sensor_temperature.h diff --git a/src/libsensord/sensor_tilt.h b/src/shared/sensor_tilt.h similarity index 100% rename from src/libsensord/sensor_tilt.h rename to src/shared/sensor_tilt.h diff --git a/src/libsensord/sensor_ultraviolet.h b/src/shared/sensor_ultraviolet.h similarity index 100% rename from src/libsensord/sensor_ultraviolet.h rename to src/shared/sensor_ultraviolet.h diff --git a/src/libsensord/sensor_uncal_gyro.h b/src/shared/sensor_uncal_gyro.h similarity index 100% rename from src/libsensord/sensor_uncal_gyro.h rename to src/shared/sensor_uncal_gyro.h -- 2.7.4 From d0ee3f5336d7a9e849f60587612733af3d3e173b Mon Sep 17 00:00:00 2001 From: Ankur Date: Thu, 22 Oct 2015 12:45:08 +0530 Subject: [PATCH 02/16] Migrating some code to calculate event from proxi_sensor_hal to proxi_sensor This code basically checks if the value read is for far or near and based on that, assigns a enum value to the event. This code needs to be moved to proxi_sensor.cpp so that dependency between sensor_internal.h and proxi_sensor_hal.cpp is removed as proxi_sensor_hal.cpp needs to be moved to a separate repo later. signed-off-by:"Ankur Garg " Change-Id: I5a088dc8b5de42f445e7c948b9d539e02167e905 --- src/plugins/proxi/proxi_sensor.cpp | 11 +++++++++++ src/plugins/proxi/proxi_sensor.h | 13 +++++++++++++ src/plugins/proxi/proxi_sensor_hal.cpp | 13 ++----------- src/plugins/proxi/proxi_sensor_hal.h | 13 ------------- 4 files changed, 26 insertions(+), 24 deletions(-) diff --git a/src/plugins/proxi/proxi_sensor.cpp b/src/plugins/proxi/proxi_sensor.cpp index 05352d1..9486de7 100755 --- a/src/plugins/proxi/proxi_sensor.cpp +++ b/src/plugins/proxi/proxi_sensor.cpp @@ -82,6 +82,17 @@ bool proxi_sensor::process_event(void) AUTOLOCK(m_client_info_mutex); AUTOLOCK(m_mutex); + if (event.data.values[0] == PROXIMITY_NODE_STATE_FAR) { + INFO("PROXIMITY_STATE_FAR state occured\n"); + event.data.values[0] = PROXIMITY_STATE_FAR; + } else if (event.data.values[0] == PROXIMITY_NODE_STATE_NEAR) { + INFO("PROXIMITY_STATE_NEAR state occured\n"); + event.data.values[0] = PROXIMITY_STATE_NEAR; + } else { + ERR("PROXIMITY_STATE Unknown: %d\n",event.data.values[0]); + return false; + } + event.sensor_id = get_id(); if (get_client_cnt(PROXIMITY_DISTANCE_DATA_EVENT)) { event.event_type = PROXIMITY_DISTANCE_DATA_EVENT; diff --git a/src/plugins/proxi/proxi_sensor.h b/src/plugins/proxi/proxi_sensor.h index 9c3a009..97e5dba 100755 --- a/src/plugins/proxi/proxi_sensor.h +++ b/src/plugins/proxi/proxi_sensor.h @@ -26,6 +26,19 @@ class proxi_sensor : public physical_sensor { public: + enum proxi_node_state_event_t { //changed as per Input Event Method definitions + PROXIMITY_NODE_STATE_NEAR = 0, + PROXIMITY_NODE_STATE_FAR = 1, + PROXIMITY_NODE_STATE_UNKNOWN = -1, + }; + +// In case of IIO input method, use the following definitions as the values returned by sensor are different. +// enum proxi_node_state_event_t { //changed as per IIO Method definitions +// PROXIMITY_NODE_STATE_NEAR = 1, +// PROXIMITY_NODE_STATE_FAR = 2, +// PROXIMITY_NODE_STATE_UNKNOWN = 0, +// }; + proxi_sensor(); virtual ~proxi_sensor(); diff --git a/src/plugins/proxi/proxi_sensor_hal.cpp b/src/plugins/proxi/proxi_sensor_hal.cpp index 7358b08..0d82907 100755 --- a/src/plugins/proxi/proxi_sensor_hal.cpp +++ b/src/plugins/proxi/proxi_sensor_hal.cpp @@ -36,7 +36,7 @@ using std::ifstream; #define PROXI_CODE 0x0019 proxi_sensor_hal::proxi_sensor_hal() -: m_state(PROXIMITY_STATE_FAR) +: m_state(-1) , m_fired_time(0) , m_node_handle(-1) { @@ -149,16 +149,7 @@ bool proxi_sensor_hal::update_value(bool wait) DBG("read event, len : %d , type : %x , code : %x , value : %x", len, proxi_event.type, proxi_event.code, proxi_event.value); if ((proxi_event.type == EV_ABS) && (proxi_event.code == PROXI_CODE)) { AUTOLOCK(m_value_mutex); - if (proxi_event.value == PROXIMITY_NODE_STATE_FAR) { - INFO("PROXIMITY_STATE_FAR state occured\n"); - m_state = PROXIMITY_STATE_FAR; - } else if (proxi_event.value == PROXIMITY_NODE_STATE_NEAR) { - INFO("PROXIMITY_STATE_NEAR state occured\n"); - m_state = PROXIMITY_STATE_NEAR; - } else { - ERR("PROXIMITY_STATE Unknown: %d\n",proxi_event.value); - return false; - } + m_state = proxi_event.value; m_fired_time = sensor_hal::get_timestamp(&proxi_event.time); } else { return false; diff --git a/src/plugins/proxi/proxi_sensor_hal.h b/src/plugins/proxi/proxi_sensor_hal.h index a1cd3a1..d906ed6 100755 --- a/src/plugins/proxi/proxi_sensor_hal.h +++ b/src/plugins/proxi/proxi_sensor_hal.h @@ -25,19 +25,6 @@ class proxi_sensor_hal : public sensor_hal { public: - enum proxi_node_state_event_t { //changed as per Input Event Method definitions - PROXIMITY_NODE_STATE_NEAR = 0, - PROXIMITY_NODE_STATE_FAR = 1, - PROXIMITY_NODE_STATE_UNKNOWN = -1, - }; - -// In case of IIO input method, use the following definitions as the values returned by sensor are different. -// enum proxi_node_state_event_t { //changed as per IIO Method definitions -// PROXIMITY_NODE_STATE_NEAR = 1, -// PROXIMITY_NODE_STATE_FAR = 2, -// PROXIMITY_NODE_STATE_UNKNOWN = 0, -// }; - proxi_sensor_hal(); virtual ~proxi_sensor_hal(); std::string get_model_id(void); -- 2.7.4 From bc243427106021361dfa67543cd9c67e1691c80c Mon Sep 17 00:00:00 2001 From: Adarsh Shree Ram Date: Thu, 1 Oct 2015 15:07:50 +0530 Subject: [PATCH 03/16] Repositioning of header files for improving modularity The header files are repositioned to remove existing depencies between files that are to be added to a new repo. Change-Id: I94da30600627453dba0c60151627e2df7ff86d21 --- src/server/command_worker.h | 1 + src/shared/sensor_base.h | 1 + src/shared/sensor_hal.h | 1 - src/shared/sf_common.h | 2 -- 4 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/server/command_worker.h b/src/server/command_worker.h index 88000c8..8f7b7a8 100644 --- a/src/server/command_worker.h +++ b/src/server/command_worker.h @@ -25,6 +25,7 @@ #include #include #include +#include typedef std::multimap sensor_raw_data_map; void insert_priority_list(unsigned int); diff --git a/src/shared/sensor_base.h b/src/shared/sensor_base.h index 6eaf01d..90e27e9 100644 --- a/src/shared/sensor_base.h +++ b/src/shared/sensor_base.h @@ -27,6 +27,7 @@ #include #include #include +#include #include #include diff --git a/src/shared/sensor_hal.h b/src/shared/sensor_hal.h index c1afba5..7111276 100644 --- a/src/shared/sensor_hal.h +++ b/src/shared/sensor_hal.h @@ -23,7 +23,6 @@ #include #include #include -#include #include /* diff --git a/src/shared/sf_common.h b/src/shared/sf_common.h index 8c802de..381ac45 100644 --- a/src/shared/sf_common.h +++ b/src/shared/sf_common.h @@ -22,8 +22,6 @@ #if !defined(_SF_COMMON_H_) #define _SF_COMMON_H_ #include -#include -#include #include #include #include -- 2.7.4 From bbf6831077cce49339f8427df017cc19f8b769dc Mon Sep 17 00:00:00 2001 From: Ankur Date: Thu, 22 Oct 2015 14:41:12 +0530 Subject: [PATCH 04/16] Deleting unused file crw_lock.h and crw_lock.cpp this class was not being used anywhere. Change-Id: Ib379cb65bae7de550b470fe00b7f490c73e20bd0 --- src/shared/CMakeLists.txt | 2 -- src/shared/crw_lock.cpp | 74 ----------------------------------------------- src/shared/crw_lock.h | 46 ----------------------------- 3 files changed, 122 deletions(-) delete mode 100755 src/shared/crw_lock.cpp delete mode 100755 src/shared/crw_lock.h diff --git a/src/shared/CMakeLists.txt b/src/shared/CMakeLists.txt index 91c6b32..dc5c9b3 100644 --- a/src/shared/CMakeLists.txt +++ b/src/shared/CMakeLists.txt @@ -18,7 +18,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) add_library(sensord-server SHARED - crw_lock.cpp worker_thread.cpp cconfig.cpp csensor_config.cpp @@ -56,7 +55,6 @@ install(TARGETS sensord-share DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(FILES sensord-server.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) install(FILES ${PROJECT_NAME}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) install(FILES - crw_lock.h worker_thread.h cconfig.h csensor_config.h diff --git a/src/shared/crw_lock.cpp b/src/shared/crw_lock.cpp deleted file mode 100755 index 6470f6c..0000000 --- a/src/shared/crw_lock.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * libsensord-share - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include "crw_lock.h" -#include "common.h" - - -crw_lock::crw_lock() -{ - m_rw_lock = PTHREAD_RWLOCK_INITIALIZER; -} - -crw_lock::~crw_lock() -{ - pthread_rwlock_destroy(&m_rw_lock); -} - -void crw_lock::read_lock() -{ -#ifdef _LOCK_DEBUG - cbase_lock::lock(LOCK_TYPE_READ, "read lock", __MODULE__, __func__, __LINE__); -#else - cbase_lock::lock(LOCK_TYPE_READ); -#endif -} - -void crw_lock::write_lock() -{ -#ifdef _LOCK_DEBUG - cbase_lock::lock(LOCK_TYPE_WRITE, "write lock", __MODULE__, __func__, __LINE__); -#else - cbase_lock::lock(LOCK_TYPE_WRITE); -#endif -} - -int crw_lock::read_lock_impl(void) -{ - return pthread_rwlock_rdlock(&m_rw_lock); -} -int crw_lock::write_lock_impl(void) -{ - return pthread_rwlock_wrlock(&m_rw_lock); -} - -int crw_lock::try_read_lock_impl(void) -{ - return pthread_rwlock_tryrdlock(&m_rw_lock); -} - -int crw_lock::try_write_lock_impl(void) -{ - return pthread_rwlock_trywrlock(&m_rw_lock); -} - -int crw_lock::unlock_impl() -{ - return pthread_rwlock_unlock(&m_rw_lock); -} diff --git a/src/shared/crw_lock.h b/src/shared/crw_lock.h deleted file mode 100755 index b2a33b3..0000000 --- a/src/shared/crw_lock.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * libsensord-share - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#if !defined(_CRW_LOCK_CLASS_H_) -#define _CRW_LOCK_CLASS_H_ - -#include "cbase_lock.h" - -class crw_lock : public cbase_lock -{ -public: - crw_lock(); - virtual ~crw_lock(); - - void read_lock(); - void write_lock(); - -protected: - int read_lock_impl(void); - int write_lock_impl(void); - - int try_read_lock_impl(void); - int try_write_lock_impl(void); - int unlock_impl(); -private: - pthread_rwlock_t m_rw_lock; -}; - -#endif -// End of a file -- 2.7.4 From f233e213cd4993f4095865f999048b0dacc998a6 Mon Sep 17 00:00:00 2001 From: Ankur Date: Thu, 22 Oct 2015 15:16:24 +0530 Subject: [PATCH 05/16] Moving hal files to new repo and updating CMakeLists and spec file -Deleting the Hal files for each sensor (moved to new repo) -updating CMakelists for each sensor and shared/libsensord/server folders -added the new project as the dependency in the spec file and the CMakelists Change-Id: I313cf9ef00e86bea8fe852ded64c28a58d52f2d2 --- CMakeLists.txt | 3 +- packaging/sensord.spec | 2 +- sensor_plugins.xml.in | 18 +- sensors.xml.in | 384 --------------------- src/libsensord/CMakeLists.txt | 2 +- src/plugins/accel/CMakeLists.txt | 7 - src/plugins/accel/accel_sensor_hal.cpp | 383 -------------------- src/plugins/accel/accel_sensor_hal.h | 69 ---- src/plugins/bio_led_red/CMakeLists.txt | 7 - src/plugins/bio_led_red/bio_led_red_sensor_hal.cpp | 265 -------------- src/plugins/bio_led_red/bio_led_red_sensor_hal.h | 62 ---- src/plugins/geo/CMakeLists.txt | 7 - src/plugins/geo/geo_sensor_hal.cpp | 316 ----------------- src/plugins/geo/geo_sensor_hal.h | 67 ---- src/plugins/gyro/CMakeLists.txt | 6 - src/plugins/gyro/gyro_sensor_hal.cpp | 306 ---------------- src/plugins/gyro/gyro_sensor_hal.h | 66 ---- src/plugins/light/CMakeLists.txt | 7 - src/plugins/light/light_sensor_hal.cpp | 248 ------------- src/plugins/light/light_sensor_hal.h | 60 ---- src/plugins/pressure/CMakeLists.txt | 7 - src/plugins/pressure/pressure_sensor_hal.cpp | 321 ----------------- src/plugins/pressure/pressure_sensor_hal.h | 70 ---- src/plugins/proxi/CMakeLists.txt | 7 - src/plugins/proxi/proxi_sensor_hal.cpp | 207 ----------- src/plugins/proxi/proxi_sensor_hal.h | 55 --- src/plugins/rotation_vector/rv_raw/CMakeLists.txt | 7 - .../rotation_vector/rv_raw/rv_raw_sensor_hal.cpp | 289 ---------------- .../rotation_vector/rv_raw/rv_raw_sensor_hal.h | 65 ---- src/plugins/temperature/CMakeLists.txt | 7 - src/plugins/temperature/temperature_sensor_hal.cpp | 275 --------------- src/plugins/temperature/temperature_sensor_hal.h | 60 ---- src/plugins/ultraviolet/CMakeLists.txt | 7 - src/plugins/ultraviolet/ultraviolet_sensor_hal.cpp | 292 ---------------- src/plugins/ultraviolet/ultraviolet_sensor_hal.h | 66 ---- src/server/CMakeLists.txt | 2 +- src/shared/CMakeLists.txt | 16 - 37 files changed, 13 insertions(+), 4025 deletions(-) delete mode 100755 sensors.xml.in delete mode 100755 src/plugins/accel/accel_sensor_hal.cpp delete mode 100755 src/plugins/accel/accel_sensor_hal.h delete mode 100755 src/plugins/bio_led_red/bio_led_red_sensor_hal.cpp delete mode 100755 src/plugins/bio_led_red/bio_led_red_sensor_hal.h delete mode 100755 src/plugins/geo/geo_sensor_hal.cpp delete mode 100755 src/plugins/geo/geo_sensor_hal.h delete mode 100755 src/plugins/gyro/gyro_sensor_hal.cpp delete mode 100755 src/plugins/gyro/gyro_sensor_hal.h delete mode 100755 src/plugins/light/light_sensor_hal.cpp delete mode 100755 src/plugins/light/light_sensor_hal.h delete mode 100755 src/plugins/pressure/pressure_sensor_hal.cpp delete mode 100755 src/plugins/pressure/pressure_sensor_hal.h delete mode 100755 src/plugins/proxi/proxi_sensor_hal.cpp delete mode 100755 src/plugins/proxi/proxi_sensor_hal.h delete mode 100755 src/plugins/rotation_vector/rv_raw/rv_raw_sensor_hal.cpp delete mode 100755 src/plugins/rotation_vector/rv_raw/rv_raw_sensor_hal.h delete mode 100755 src/plugins/temperature/temperature_sensor_hal.cpp delete mode 100755 src/plugins/temperature/temperature_sensor_hal.h delete mode 100755 src/plugins/ultraviolet/ultraviolet_sensor_hal.cpp delete mode 100755 src/plugins/ultraviolet/ultraviolet_sensor_hal.h diff --git a/CMakeLists.txt b/CMakeLists.txt index affaa30..20079c1 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,9 +24,8 @@ add_definitions(-DLIBDIR="${CMAKE_INSTALL_LIBDIR}") # Installing files CONFIGURE_FILE(sensor_plugins.xml.in sensor_plugins.xml @ONLY) -CONFIGURE_FILE(sensors.xml.in sensors.xml @ONLY) -INSTALL(FILES sensor_plugins.xml sensors.xml DESTINATION etc) +INSTALL(FILES sensor_plugins.xml DESTINATION etc) INSTALL(FILES virtual_sensors.xml virtual_sensors.xml DESTINATION etc) # Sub-directory diff --git a/packaging/sensord.spec b/packaging/sensord.spec index dd4ea37..92d9bad 100644 --- a/packaging/sensord.spec +++ b/packaging/sensord.spec @@ -16,6 +16,7 @@ BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(vconf) BuildRequires: pkgconfig(libsystemd-daemon) BuildRequires: pkgconfig(capi-system-info) +BuildRequires: pkgconfig(sensor-hal) BuildRequires: pkgconfig(cynara-creds-socket) BuildRequires: pkgconfig(cynara-client) BuildRequires: pkgconfig(cynara-session) @@ -116,7 +117,6 @@ systemctl daemon-reload %files -n sensord %attr(0644,root,root)/usr/etc/sensor_plugins.xml -%attr(0644,root,root)/usr/etc/sensors.xml %attr(0644,root,root)/usr/etc/virtual_sensors.xml %manifest sensord.manifest %{_bindir}/sensord diff --git a/sensor_plugins.xml.in b/sensor_plugins.xml.in index 88eb161..603b0a9 100755 --- a/sensor_plugins.xml.in +++ b/sensor_plugins.xml.in @@ -1,14 +1,14 @@ - - - - - - - - - + + + + + + + + + diff --git a/sensors.xml.in b/sensors.xml.in deleted file mode 100755 index 34894f3..0000000 --- a/sensors.xml.in +++ /dev/null @@ -1,384 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/libsensord/CMakeLists.txt b/src/libsensord/CMakeLists.txt index 3f989c8..d85785c 100755 --- a/src/libsensord/CMakeLists.txt +++ b/src/libsensord/CMakeLists.txt @@ -29,7 +29,7 @@ add_library(${PROJECT_NAME} SHARED poller.cpp ) -target_link_libraries(${PROJECT_NAME} ${lib_pkgs_LDFLAGS} "sensord-share") +target_link_libraries(${PROJECT_NAME} ${lib_pkgs_LDFLAGS} "sensord-share" "sensor-hal") SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR}) SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION}) diff --git a/src/plugins/accel/CMakeLists.txt b/src/plugins/accel/CMakeLists.txt index 2537c1c..4fcaf97 100755 --- a/src/plugins/accel/CMakeLists.txt +++ b/src/plugins/accel/CMakeLists.txt @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 2.6) project(accel CXX) SET(SENSOR_NAME accel_sensor) -SET(SENSOR_HAL_NAME accel_sensor_hal) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) @@ -19,12 +18,6 @@ add_library(${SENSOR_NAME} SHARED accel_sensor.cpp ) -add_library(${SENSOR_HAL_NAME} SHARED - accel_sensor_hal.cpp - ) - target_link_libraries(${SENSOR_NAME} ${accel_pkgs_LDFLAGS} "-lm") -target_link_libraries(${SENSOR_HAL_NAME} ${accel_pkgs_LDFLAGS}) install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) -install(TARGETS ${SENSOR_HAL_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/plugins/accel/accel_sensor_hal.cpp b/src/plugins/accel/accel_sensor_hal.cpp deleted file mode 100755 index ac709a5..0000000 --- a/src/plugins/accel/accel_sensor_hal.cpp +++ /dev/null @@ -1,383 +0,0 @@ -/* - * accel_sensor_hal - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#include -#include -#include -#include -#include -#include - -using std::ifstream; -using std::string; - -#define GRAVITY 9.80665 -#define G_TO_MG 1000 -#define RAW_DATA_TO_G_UNIT(X) (((float)(X))/((float)G_TO_MG)) -#define RAW_DATA_TO_METRE_PER_SECOND_SQUARED_UNIT(X) (GRAVITY * (RAW_DATA_TO_G_UNIT(X))) - -#define MIN_RANGE(RES) (-((1 << (RES))/2)) -#define MAX_RANGE(RES) (((1 << (RES))/2)-1) - -#define SENSOR_TYPE_ACCEL "ACCEL" -#define ELEMENT_NAME "NAME" -#define ELEMENT_VENDOR "VENDOR" -#define ELEMENT_RAW_DATA_UNIT "RAW_DATA_UNIT" -#define ELEMENT_RESOLUTION "RESOLUTION" - -#define ATTR_VALUE "value" - -#define INPUT_NAME "accelerometer_sensor" -#define ACCEL_SENSORHUB_POLL_NODE_NAME "accel_poll_delay" - -accel_sensor_hal::accel_sensor_hal() -: m_x(-1) -, m_y(-1) -, m_z(-1) -, m_node_handle(-1) -, m_polling_interval(POLL_1HZ_MS) -, m_fired_time(0) -{ - const string sensorhub_interval_node_name = "accel_poll_delay"; - csensor_config &config = csensor_config::get_instance(); - - node_info_query query; - node_info info; - - if (!find_model_id(SENSOR_TYPE_ACCEL, m_model_id)) { - ERR("Failed to find model id"); - throw ENXIO; - } - - query.sensorhub_controlled = m_sensorhub_controlled = is_sensorhub_controlled(sensorhub_interval_node_name); - query.sensor_type = SENSOR_TYPE_ACCEL; - query.key = "accelerometer_sensor"; - query.iio_enable_node_name = "accel_enable"; - query.sensorhub_interval_node_name = sensorhub_interval_node_name; - - if (!get_node_info(query, info)) { - ERR("Failed to get node info"); - throw ENXIO; - } - - show_node_info(info); - - m_method = info.method; - m_data_node = info.data_node_path; - m_enable_node = info.enable_node_path; - m_interval_node = info.interval_node_path; - - if (!config.get(SENSOR_TYPE_ACCEL, m_model_id, ELEMENT_VENDOR, m_vendor)) { - ERR("[VENDOR] is empty\n"); - throw ENXIO; - } - - INFO("m_vendor = %s", m_vendor.c_str()); - - if (!config.get(SENSOR_TYPE_ACCEL, m_model_id, ELEMENT_NAME, m_chip_name)) { - ERR("[NAME] is empty\n"); - throw ENXIO; - } - - INFO("m_chip_name = %s\n",m_chip_name.c_str()); - - long resolution; - - if (!config.get(SENSOR_TYPE_ACCEL, m_model_id, ELEMENT_RESOLUTION, resolution)) { - ERR("[RESOLUTION] is empty\n"); - throw ENXIO; - } - - m_resolution = (int)resolution; - - INFO("m_resolution = %d\n",m_resolution); - - double raw_data_unit; - - if (!config.get(SENSOR_TYPE_ACCEL, m_model_id, ELEMENT_RAW_DATA_UNIT, raw_data_unit)) { - ERR("[RAW_DATA_UNIT] is empty\n"); - throw ENXIO; - } - - m_raw_data_unit = (float)(raw_data_unit); - INFO("m_raw_data_unit = %f\n", m_raw_data_unit); - - if ((m_node_handle = open(m_data_node.c_str(), O_RDWR)) < 0) { - ERR("accel handle open fail for accel processor, error:%s\n", strerror(errno)); - throw ENXIO; - } - - if (m_method == INPUT_EVENT_METHOD) { - int clockId = CLOCK_MONOTONIC; - if (ioctl(m_node_handle, EVIOCSCLOCKID, &clockId) != 0) - ERR("Fail to set monotonic timestamp for %s", m_data_node.c_str()); - - update_value = [=](bool wait) { - return this->update_value_input_event(wait); - }; - } else { - if (!info.buffer_length_node_path.empty()) - set_node_value(info.buffer_length_node_path, 480); - - if (!info.buffer_enable_node_path.empty()) - set_node_value(info.buffer_enable_node_path, 1); - - update_value = [=](bool wait) { - return this->update_value_iio(wait); - }; - } - - INFO("accel_sensor is created!\n"); -} - -accel_sensor_hal::~accel_sensor_hal() -{ - close(m_node_handle); - m_node_handle = -1; - - INFO("accel_sensor is destroyed!\n"); -} - -string accel_sensor_hal::get_model_id(void) -{ - return m_model_id; -} - -sensor_hal_type_t accel_sensor_hal::get_type(void) -{ - return SENSOR_HAL_TYPE_ACCELEROMETER; -} - -bool accel_sensor_hal::enable(void) -{ - AUTOLOCK(m_mutex); - - set_enable_node(m_enable_node, m_sensorhub_controlled, true, SENSORHUB_ACCELEROMETER_ENABLE_BIT); - set_interval(m_polling_interval); - - m_fired_time = 0; - INFO("Accel sensor real starting"); - return true; -} - -bool accel_sensor_hal::disable(void) -{ - AUTOLOCK(m_mutex); - - set_enable_node(m_enable_node, m_sensorhub_controlled, false, SENSORHUB_ACCELEROMETER_ENABLE_BIT); - - INFO("Accel sensor real stopping"); - return true; -} - -bool accel_sensor_hal::set_interval(unsigned long val) -{ - unsigned long long polling_interval_ns; - - AUTOLOCK(m_mutex); - - polling_interval_ns = ((unsigned long long)(val) * 1000llu * 1000llu); - - if (!set_node_value(m_interval_node, polling_interval_ns)) { - ERR("Failed to set polling resource: %s\n", m_interval_node.c_str()); - return false; - } - - INFO("Interval is changed from %dms to %dms]", m_polling_interval, val); - m_polling_interval = val; - return true; -} - - -bool accel_sensor_hal::update_value_input_event(bool wait) -{ - int accel_raw[3] = {0,}; - bool x,y,z; - int read_input_cnt = 0; - const int INPUT_MAX_BEFORE_SYN = 10; - unsigned long long fired_time = 0; - bool syn = false; - - x = y = z = false; - - struct input_event accel_input; - DBG("accel event detection!"); - - while ((syn == false) && (read_input_cnt < INPUT_MAX_BEFORE_SYN)) { - int len = read(m_node_handle, &accel_input, sizeof(accel_input)); - if (len != sizeof(accel_input)) { - ERR("accel_file read fail, read_len = %d\n",len); - return false; - } - - ++read_input_cnt; - - if (accel_input.type == EV_REL) { - switch (accel_input.code) { - case REL_X: - accel_raw[0] = (int)accel_input.value; - x = true; - break; - case REL_Y: - accel_raw[1] = (int)accel_input.value; - y = true; - break; - case REL_Z: - accel_raw[2] = (int)accel_input.value; - z = true; - break; - default: - ERR("accel_input event[type = %d, code = %d] is unknown.", accel_input.type, accel_input.code); - return false; - break; - } - } else if (accel_input.type == EV_SYN) { - syn = true; - fired_time = sensor_hal::get_timestamp(&accel_input.time); - } else { - ERR("accel_input event[type = %d, code = %d] is unknown.", accel_input.type, accel_input.code); - return false; - } - } - - if (syn == false) { - ERR("EV_SYN didn't come until %d inputs had come", read_input_cnt); - return false; - } - - AUTOLOCK(m_value_mutex); - - if (x) - m_x = accel_raw[0]; - if (y) - m_y = accel_raw[1]; - if (z) - m_z = accel_raw[2]; - - m_fired_time = fired_time; - - DBG("m_x = %d, m_y = %d, m_z = %d, time = %lluus", m_x, m_y, m_z, m_fired_time); - - return true; -} - - -bool accel_sensor_hal::update_value_iio(bool wait) -{ - const int READ_LEN = 14; - char data[READ_LEN] = {0,}; - - struct pollfd pfd; - - pfd.fd = m_node_handle; - pfd.events = POLLIN | POLLERR; - pfd.revents = 0; - - int ret = poll(&pfd, 1, -1); - - if (ret == -1) { - ERR("poll error:%s m_node_handle:d", strerror(errno), m_node_handle); - return false; - } else if (!ret) { - ERR("poll timeout m_node_handle:%d", m_node_handle); - return false; - } - - if (pfd.revents & POLLERR) { - ERR("poll exception occurred! m_node_handle:%d", m_node_handle); - return false; - } - - if (!(pfd.revents & POLLIN)) { - ERR("poll nothing to read! m_node_handle:%d, pfd.revents = %d", m_node_handle, pfd.revents); - return false; - } - - int len = read(m_node_handle, data, sizeof(data)); - - if (len != sizeof(data)) { - ERR("Failed to read data, m_node_handle:%d read_len:%d", m_node_handle, len); - return false; - } - - AUTOLOCK(m_value_mutex); - - short *short_data = (short *)(data); - m_x = *(short_data); - m_y = *((short *)(data + 2)); - m_z = *((short *)(data + 4)); - - m_fired_time = *((long long*)(data + 6)); - - INFO("m_x = %d, m_y = %d, m_z = %d, time = %lluus", m_x, m_y, m_z, m_fired_time); - - return true; - -} - -bool accel_sensor_hal::is_data_ready(bool wait) -{ - bool ret; - ret = update_value(wait); - return ret; -} - -int accel_sensor_hal::get_sensor_data(sensor_data_t &data) -{ - AUTOLOCK(m_value_mutex); - - data.accuracy = SENSOR_ACCURACY_GOOD; - data.timestamp = m_fired_time; - data.value_count = 3; - data.values[0] = m_x; - data.values[1] = m_y; - data.values[2] = m_z; - - return 0; -} - -bool accel_sensor_hal::get_properties(sensor_properties_s &properties) -{ - properties.name = m_chip_name; - properties.vendor = m_vendor; - properties.min_range = MIN_RANGE(m_resolution)* RAW_DATA_TO_METRE_PER_SECOND_SQUARED_UNIT(m_raw_data_unit); - properties.max_range = MAX_RANGE(m_resolution)* RAW_DATA_TO_METRE_PER_SECOND_SQUARED_UNIT(m_raw_data_unit); - properties.min_interval = 1; - properties.resolution = RAW_DATA_TO_METRE_PER_SECOND_SQUARED_UNIT(m_raw_data_unit); - properties.fifo_count = 0; - properties.max_batch_count = 0; - return true; -} - -extern "C" sensor_module* create(void) -{ - accel_sensor_hal *sensor; - - try { - sensor = new(std::nothrow) accel_sensor_hal; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/plugins/accel/accel_sensor_hal.h b/src/plugins/accel/accel_sensor_hal.h deleted file mode 100755 index f16d94c..0000000 --- a/src/plugins/accel/accel_sensor_hal.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * accel_sensor_hal - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef _ACCEL_SENSOR_HAL_H_ -#define _ACCEL_SENSOR_HAL_H_ - -#include -#include - -class accel_sensor_hal : public sensor_hal -{ -public: - accel_sensor_hal(); - virtual ~accel_sensor_hal(); - std::string get_model_id(void); - sensor_hal_type_t get_type(void); - bool enable(void); - bool disable(void); - bool set_interval(unsigned long val); - bool is_data_ready(bool wait); - virtual int get_sensor_data(sensor_data_t &data); - bool get_properties(sensor_properties_s &properties); - -private: - int m_x; - int m_y; - int m_z; - int m_node_handle; - unsigned long m_polling_interval; - unsigned long long m_fired_time; - - std::string m_model_id; - std::string m_vendor; - std::string m_chip_name; - - int m_resolution; - float m_raw_data_unit; - - int m_method; - std::string m_data_node; - std::string m_enable_node; - std::string m_interval_node; - - std::function update_value; - - bool m_sensorhub_controlled; - - cmutex m_value_mutex; - - bool update_value_input_event(bool wait); - bool update_value_iio(bool wait); -}; -#endif /*_ACCEL_SENSOR_HAL_CLASS_H_*/ diff --git a/src/plugins/bio_led_red/CMakeLists.txt b/src/plugins/bio_led_red/CMakeLists.txt index 04c58e8..1911384 100644 --- a/src/plugins/bio_led_red/CMakeLists.txt +++ b/src/plugins/bio_led_red/CMakeLists.txt @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 2.6) project(bio_led_red CXX) SET(SENSOR_NAME bio_led_red_sensor) -SET(SENSOR_HAL_NAME bio_led_red_sensor_hal) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) @@ -19,12 +18,6 @@ add_library(${SENSOR_NAME} SHARED bio_led_red_sensor.cpp ) -add_library(${SENSOR_HAL_NAME} SHARED - bio_led_red_sensor_hal.cpp - ) - target_link_libraries(${SENSOR_NAME} ${bio_led_red_pkgs_LDFLAGS} "-lm") -target_link_libraries(${SENSOR_HAL_NAME} ${bio_led_red_pkgs_LDFLAGS}) install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) -install(TARGETS ${SENSOR_HAL_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/plugins/bio_led_red/bio_led_red_sensor_hal.cpp b/src/plugins/bio_led_red/bio_led_red_sensor_hal.cpp deleted file mode 100755 index 59fea6a..0000000 --- a/src/plugins/bio_led_red/bio_led_red_sensor_hal.cpp +++ /dev/null @@ -1,265 +0,0 @@ -/* - * bio_led_red_sensor_hal - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#include -#include -#include -#include -#include -#include -#include -#include - -using std::ifstream; -using std::string; - -#define SENSOR_TYPE_BIO_LED_RED "BIO_LED_RED" -#define ELEMENT_NAME "NAME" -#define ELEMENT_VENDOR "VENDOR" -#define ATTR_VALUE "value" -#define PATH_LED_RED_ENABLE "/sys/class/sensors/hrm_sensor/led_current1"; -#define LED_RED_ENABLE_VALUE 255 - -#define BIAS 1 - -bio_led_red_sensor_hal::bio_led_red_sensor_hal() -: m_polling_interval(POLL_1HZ_MS) -, m_bio_led_red(0) -, m_fired_time(0) -, m_node_handle(-1) -{ - const string sensorhub_interval_node_name = "hrm_poll_delay"; - csensor_config &config = csensor_config::get_instance(); - - node_info_query query; - node_info info; - - if (!find_model_id(SENSOR_TYPE_BIO_LED_RED, m_model_id)) { - ERR("Failed to find model id"); - throw ENXIO; - - } - - query.sensorhub_controlled = m_sensorhub_controlled = is_sensorhub_controlled(sensorhub_interval_node_name); - query.sensor_type = SENSOR_TYPE_BIO_LED_RED; - query.key = "hrm_sensor"; - query.iio_enable_node_name = "hrm_raw_enable"; - query.sensorhub_interval_node_name = sensorhub_interval_node_name; - - if (!get_node_info(query, info)) { - ERR("Failed to get node info"); - throw ENXIO; - } - - show_node_info(info); - - m_data_node = info.data_node_path; - m_enable_node = info.enable_node_path; - m_interval_node = info.interval_node_path; - - if (!config.get(SENSOR_TYPE_BIO_LED_RED, m_model_id, ELEMENT_VENDOR, m_vendor)) { - ERR("[VENDOR] is empty\n"); - throw ENXIO; - } - - INFO("m_vendor = %s", m_vendor.c_str()); - - if (!config.get(SENSOR_TYPE_BIO_LED_RED, m_model_id, ELEMENT_NAME, m_chip_name)) { - ERR("[NAME] is empty\n"); - throw ENXIO; - } - - INFO("m_chip_name = %s\n",m_chip_name.c_str()); - - if ((m_node_handle = open(m_data_node.c_str(),O_RDWR)) < 0) { - ERR("Failed to open handle(%d)", m_node_handle); - throw ENXIO; - } - - int clockId = CLOCK_MONOTONIC; - if (ioctl(m_node_handle, EVIOCSCLOCKID, &clockId) != 0) - ERR("Fail to set monotonic timestamp for %s", m_data_node.c_str()); - - INFO("bio_led_red_sensor_hal is created!\n"); - -} - -bio_led_red_sensor_hal::~bio_led_red_sensor_hal() -{ - close(m_node_handle); - m_node_handle = -1; - - INFO("bio_led_red_sensor_hal is destroyed!\n"); -} - -string bio_led_red_sensor_hal::get_model_id(void) -{ - return m_model_id; -} - - -sensor_hal_type_t bio_led_red_sensor_hal::get_type(void) -{ - return SENSOR_HAL_TYPE_BIO_LED_RED; -} - -bool bio_led_red_sensor_hal::enable(void) -{ - AUTOLOCK(m_mutex); - const string led_red_enable_path = PATH_LED_RED_ENABLE; - - set_enable_node(m_enable_node, m_sensorhub_controlled, true, SENSORHUB_BIO_HRM_RAW_ENABLE_BIT); - - if (!set_node_value(led_red_enable_path, LED_RED_ENABLE_VALUE)) { - ERR("Failed to set led red enable node: %s", led_red_enable_path.c_str()); - return false; - } - - set_interval(m_polling_interval); - - m_fired_time = 0; - INFO("bio_led_red sensor starting"); - return true; -} - -bool bio_led_red_sensor_hal::disable(void) -{ - AUTOLOCK(m_mutex); - - set_enable_node(m_enable_node, m_sensorhub_controlled, false, SENSORHUB_BIO_HRM_RAW_ENABLE_BIT); - - INFO("bio_led_red sensor real stopping"); - return true; -} - -bool bio_led_red_sensor_hal::set_interval(unsigned long val) -{ - unsigned long long polling_interval_ns; - - AUTOLOCK(m_mutex); - - polling_interval_ns = ((unsigned long long)(val) * 1000llu * 1000llu); - - if (!set_node_value(m_interval_node, polling_interval_ns)) { - ERR("Failed to set polling resource: %s\n", m_interval_node.c_str()); - return false; - } - - INFO("Interval is changed from %dms to %dms]", m_polling_interval, val); - m_polling_interval = val; - return true; - -} - - -bool bio_led_red_sensor_hal::update_value(bool wait) -{ - int bio_led_red_raw = -1; - bool bio_led_red = false; - int read_input_cnt = 0; - const int INPUT_MAX_BEFORE_SYN = 10; - unsigned long long fired_time = 0; - bool syn = false; - - struct input_event bio_led_red_event; - DBG("bio_led_red event detection!"); - - while ((syn == false) && (read_input_cnt < INPUT_MAX_BEFORE_SYN)) { - int len = read(m_node_handle, &bio_led_red_event, sizeof(bio_led_red_event)); - if (len != sizeof(bio_led_red_event)) { - ERR("bio_led_red file read fail, read_len = %d\n",len); - return false; - } - - ++read_input_cnt; - - if (bio_led_red_event.type == EV_REL && bio_led_red_event.code == REL_X) { - bio_led_red_raw = (int)bio_led_red_event.value; - bio_led_red = true; - } else if (bio_led_red_event.type == EV_REL) { - ERR("bio_led_red event[type = %d, code = %d] is skipped.", bio_led_red_event.type, bio_led_red_event.code); - } else if (bio_led_red_event.type == EV_SYN) { - syn = true; - fired_time = sensor_hal::get_timestamp(&bio_led_red_event.time); - } else { - ERR("bio_led_red event[type = %d, code = %d] is unknown.", bio_led_red_event.type, bio_led_red_event.code); - return false; - } - } - - AUTOLOCK(m_value_mutex); - - if (bio_led_red) - m_bio_led_red = bio_led_red_raw - BIAS; - - m_fired_time = fired_time; - - DBG("m_bio_led_red = %d, time = %lluus", m_bio_led_red, m_fired_time); - - return true; -} - -bool bio_led_red_sensor_hal::is_data_ready(bool wait) -{ - bool ret; - ret = update_value(wait); - return ret; -} - -int bio_led_red_sensor_hal::get_sensor_data(sensor_data_t &data) -{ - AUTOLOCK(m_value_mutex); - data.accuracy = SENSOR_ACCURACY_GOOD; - data.timestamp = m_fired_time; - data.value_count = 1; - data.values[0] = (float) m_bio_led_red; - - return 0; -} - -bool bio_led_red_sensor_hal::get_properties(sensor_properties_s &properties) -{ - properties.name = m_chip_name; - properties.vendor = m_vendor; - properties.min_range = 0.0f; - properties.max_range = 1.0f; - properties.min_interval = 1; - properties.resolution = 1.0f; - properties.fifo_count = 0; - properties.max_batch_count = 0; - - return true; -} - -extern "C" sensor_module* create(void) -{ - bio_led_red_sensor_hal *sensor; - - try { - sensor = new(std::nothrow) bio_led_red_sensor_hal; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/plugins/bio_led_red/bio_led_red_sensor_hal.h b/src/plugins/bio_led_red/bio_led_red_sensor_hal.h deleted file mode 100755 index bd9059b..0000000 --- a/src/plugins/bio_led_red/bio_led_red_sensor_hal.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * hrm_red_sensor_hal - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef _BIO_LED_RED_SENSOR_HAL_H_ -#define _BIO_LED_RED_SENSOR_HAL_H_ - -#include - -class bio_led_red_sensor_hal : public sensor_hal -{ -public: - bio_led_red_sensor_hal(); - virtual ~bio_led_red_sensor_hal(); - std::string get_model_id(void); - sensor_hal_type_t get_type(void); - bool enable(void); - bool disable(void); - bool set_interval(unsigned long val); - bool is_data_ready(bool wait); - virtual int get_sensor_data(sensor_data_t &data); - bool get_properties(sensor_properties_s &properties); - -private: - std::string m_model_id; - std::string m_vendor; - std::string m_chip_name; - - unsigned long m_polling_interval; - - int m_bio_led_red; - - unsigned long long m_fired_time; - int m_node_handle; - - std::string m_enable_node; - std::string m_data_node; - std::string m_interval_node; - - bool m_sensorhub_controlled; - - cmutex m_value_mutex; - - bool update_value(bool wait); -}; -#endif /*_BIO_LED_RED_SENSOR_HAL_CLASS_H_*/ - diff --git a/src/plugins/geo/CMakeLists.txt b/src/plugins/geo/CMakeLists.txt index 8a04867..ee97dc7 100755 --- a/src/plugins/geo/CMakeLists.txt +++ b/src/plugins/geo/CMakeLists.txt @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 2.6) project(geo CXX) SET(SENSOR_NAME geo_sensor) -SET(SENSOR_HAL_NAME geo_sensor_hal) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) @@ -19,12 +18,6 @@ add_library(${SENSOR_NAME} SHARED geo_sensor.cpp ) -add_library(${SENSOR_HAL_NAME} SHARED - geo_sensor_hal.cpp -) - target_link_libraries(${SENSOR_NAME} ${geo_pkgs_LDFLAGS} "-lm") -target_link_libraries(${SENSOR_HAL_NAME} ${geo_pkgs_LDFLAGS}) install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) -install(TARGETS ${SENSOR_HAL_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/plugins/geo/geo_sensor_hal.cpp b/src/plugins/geo/geo_sensor_hal.cpp deleted file mode 100755 index 9b23ea5..0000000 --- a/src/plugins/geo/geo_sensor_hal.cpp +++ /dev/null @@ -1,316 +0,0 @@ -/* - * geo_sensor_hal - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#include -#include -#include -#include -#include -#include -#include -#include - -using std::ifstream; -using std::string; - -#define SENSOR_TYPE_MAGNETIC "MAGNETIC" -#define ELEMENT_NAME "NAME" -#define ELEMENT_VENDOR "VENDOR" -#define ELEMENT_RAW_DATA_UNIT "RAW_DATA_UNIT" -#define ELEMENT_MIN_RANGE "MIN_RANGE" -#define ELEMENT_MAX_RANGE "MAX_RANGE" -#define ATTR_VALUE "value" - -geo_sensor_hal::geo_sensor_hal() -: m_x(0) -, m_y(0) -, m_z(0) -, m_hdst(0) -, m_fired_time(0) -, m_node_handle(-1) -, m_polling_interval(POLL_1HZ_MS) -{ - const string sensorhub_interval_node_name = "mag_poll_delay"; - csensor_config &config = csensor_config::get_instance(); - - node_info_query query; - node_info info; - - if (!find_model_id(SENSOR_TYPE_MAGNETIC, m_model_id)) { - ERR("Failed to find model id"); - throw ENXIO; - } - - query.sensorhub_controlled = m_sensorhub_controlled = is_sensorhub_controlled(sensorhub_interval_node_name); - query.sensor_type = SENSOR_TYPE_MAGNETIC; - query.key = "geomagnetic_sensor"; - query.iio_enable_node_name = "geomagnetic_enable"; - query.sensorhub_interval_node_name = sensorhub_interval_node_name; - - bool error = get_node_info(query, info); - - query.key = "magnetic_sensor"; - error |= get_node_info(query, info); - - if (!error) { - ERR("Failed to get node info"); - throw ENXIO; - } - - show_node_info(info); - - m_data_node = info.data_node_path; - m_enable_node = info.enable_node_path; - m_interval_node = info.interval_node_path; - - if (!config.get(SENSOR_TYPE_MAGNETIC, m_model_id, ELEMENT_VENDOR, m_vendor)) { - ERR("[VENDOR] is empty\n"); - throw ENXIO; - } - - INFO("m_vendor = %s", m_vendor.c_str()); - - if (!config.get(SENSOR_TYPE_MAGNETIC, m_model_id, ELEMENT_NAME, m_chip_name)) { - ERR("[NAME] is empty\n"); - throw ENXIO; - } - - INFO("m_chip_name = %s\n",m_chip_name.c_str()); - - double min_range; - - if (!config.get(SENSOR_TYPE_MAGNETIC, m_model_id, ELEMENT_MIN_RANGE, min_range)) { - ERR("[MIN_RANGE] is empty\n"); - throw ENXIO; - } - - m_min_range = (float)min_range; - INFO("m_min_range = %f\n",m_min_range); - - double max_range; - - if (!config.get(SENSOR_TYPE_MAGNETIC, m_model_id, ELEMENT_MAX_RANGE, max_range)) { - ERR("[MAX_RANGE] is empty\n"); - throw ENXIO; - } - - m_max_range = (float)max_range; - INFO("m_max_range = %f\n",m_max_range); - - double raw_data_unit; - - if (!config.get(SENSOR_TYPE_MAGNETIC, m_model_id, ELEMENT_RAW_DATA_UNIT, raw_data_unit)) { - ERR("[RAW_DATA_UNIT] is empty\n"); - throw ENXIO; - } - - m_raw_data_unit = (float)(raw_data_unit); - - if ((m_node_handle = open(m_data_node.c_str(),O_RDWR)) < 0) { - ERR("Failed to open handle(%d)", m_node_handle); - throw ENXIO; - } - - int clockId = CLOCK_MONOTONIC; - if (ioctl(m_node_handle, EVIOCSCLOCKID, &clockId) != 0) - ERR("Fail to set monotonic timestamp for %s", m_data_node.c_str()); - - INFO("m_raw_data_unit = %f\n", m_raw_data_unit); - INFO("geo_sensor_hal is created!\n"); - -} - -geo_sensor_hal::~geo_sensor_hal() -{ - close(m_node_handle); - m_node_handle = -1; - - INFO("geo_sensor is destroyed!\n"); -} - -string geo_sensor_hal::get_model_id(void) -{ - return m_model_id; -} - -sensor_hal_type_t geo_sensor_hal::get_type(void) -{ - return SENSOR_HAL_TYPE_GEOMAGNETIC; -} - -bool geo_sensor_hal::enable(void) -{ - AUTOLOCK(m_mutex); - - set_enable_node(m_enable_node, m_sensorhub_controlled, true, SENSORHUB_GEOMAGNETIC_ENABLE_BIT); - set_interval(m_polling_interval); - - m_fired_time = 0; - INFO("Geo sensor real starting"); - return true; -} - -bool geo_sensor_hal::disable(void) -{ - AUTOLOCK(m_mutex); - - set_enable_node(m_enable_node, m_sensorhub_controlled, false, SENSORHUB_GEOMAGNETIC_ENABLE_BIT); - - INFO("Geo sensor real stopping"); - return true; -} - -bool geo_sensor_hal::set_interval(unsigned long val) -{ - unsigned long long polling_interval_ns; - - AUTOLOCK(m_mutex); - - polling_interval_ns = ((unsigned long long)(val) * 1000llu * 1000llu); - - if (!set_node_value(m_interval_node, polling_interval_ns)) { - ERR("Failed to set polling resource: %s\n", m_interval_node.c_str()); - return false; - } - - INFO("Interval is changed from %dms to %dms]", m_polling_interval, val); - m_polling_interval = val; - return true; -} - -bool geo_sensor_hal::update_value(bool wait) -{ - int geo_raw[4] = {0,}; - bool x,y,z,hdst; - int read_input_cnt = 0; - const int INPUT_MAX_BEFORE_SYN = 10; - unsigned long long fired_time = 0; - bool syn = false; - - x = y = z = hdst = false; - - struct input_event geo_input; - DBG("geo event detection!"); - - while ((syn == false) && (read_input_cnt < INPUT_MAX_BEFORE_SYN)) { - int len = read(m_node_handle, &geo_input, sizeof(geo_input)); - if (len != sizeof(geo_input)) { - ERR("geo_file read fail, read_len = %d\n",len); - return false; - } - - ++read_input_cnt; - - if (geo_input.type == EV_REL) { - switch (geo_input.code) { - case REL_RX: - geo_raw[0] = (int)geo_input.value; - x = true; - break; - case REL_RY: - geo_raw[1] = (int)geo_input.value; - y = true; - break; - case REL_RZ: - geo_raw[2] = (int)geo_input.value; - z = true; - break; - case REL_HWHEEL: - geo_raw[3] = (int)geo_input.value; - hdst = true; - break; - default: - ERR("geo_input event[type = %d, code = %d] is unknown.", geo_input.type, geo_input.code); - return false; - break; - } - } else if (geo_input.type == EV_SYN) { - syn = true; - fired_time = get_timestamp(&geo_input.time); - } else { - ERR("geo_input event[type = %d, code = %d] is unknown.", geo_input.type, geo_input.code); - return false; - } - } - - AUTOLOCK(m_value_mutex); - - if (x) - m_x = geo_raw[0]; - if (y) - m_y = geo_raw[1]; - if (z) - m_z = geo_raw[2]; - if (hdst) - m_hdst = geo_raw[3] - 1; /* accuracy bias: -1 */ - - m_fired_time = fired_time; - - DBG("m_x = %d, m_y = %d, m_z = %d, m_hdst = %d, time = %lluus", m_x, m_y, m_z, m_hdst, m_fired_time); - - return true; -} - -bool geo_sensor_hal::is_data_ready(bool wait) -{ - bool ret; - ret = update_value(wait); - return ret; -} - -int geo_sensor_hal::get_sensor_data(sensor_data_t &data) -{ - data.accuracy = (m_hdst == 1) ? 0 : m_hdst; /* hdst 0 and 1 are needed to calibrate */ - data.timestamp = m_fired_time; - data.value_count = 3; - data.values[0] = (float)m_x; - data.values[1] = (float)m_y; - data.values[2] = (float)m_z; - return 0; -} - -bool geo_sensor_hal::get_properties(sensor_properties_s &properties) -{ - properties.name = m_chip_name; - properties.vendor = m_vendor; - properties.min_range = m_min_range; - properties.max_range = m_max_range; - properties.min_interval = 1; - properties.resolution = m_raw_data_unit; - properties.fifo_count = 0; - properties.max_batch_count = 0; - return true; -} - -extern "C" sensor_module* create(void) -{ - geo_sensor_hal *sensor; - - try { - sensor = new(std::nothrow) geo_sensor_hal; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/plugins/geo/geo_sensor_hal.h b/src/plugins/geo/geo_sensor_hal.h deleted file mode 100755 index 0af57e8..0000000 --- a/src/plugins/geo/geo_sensor_hal.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * geo_sensor_hal - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef _GEO_SENSOR_HAL_H_ -#define _GEO_SENSOR_HAL_H_ - -#include - -class geo_sensor_hal : public sensor_hal -{ -public: - geo_sensor_hal(); - virtual ~geo_sensor_hal(); - std::string get_model_id(void); - sensor_hal_type_t get_type(void); - bool enable(void); - bool disable(void); - bool set_interval(unsigned long val); - bool is_data_ready(bool wait); - virtual int get_sensor_data(sensor_data_t &data); - bool get_properties(sensor_properties_s &properties); -private: - std::string m_model_id; - std::string m_vendor; - std::string m_chip_name; - - float m_min_range; - float m_max_range; - float m_raw_data_unit; - - double m_x; - double m_y; - double m_z; - - int m_hdst; - - unsigned long long m_fired_time; - int m_node_handle; - unsigned long m_polling_interval; - - std::string m_enable_node; - std::string m_data_node; - std::string m_interval_node; - - bool m_sensorhub_controlled; - - cmutex m_value_mutex; - - bool update_value(bool wait); -}; -#endif /*_GEO_SENSOR_HAL_H_*/ diff --git a/src/plugins/gyro/CMakeLists.txt b/src/plugins/gyro/CMakeLists.txt index 1cfef0c..c8e6d38 100755 --- a/src/plugins/gyro/CMakeLists.txt +++ b/src/plugins/gyro/CMakeLists.txt @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 2.6) project(gyro CXX) SET(SENSOR_NAME gyro_sensor) -SET(SENSOR_HAL_NAME gyro_sensor_hal) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) @@ -18,12 +17,7 @@ ENDFOREACH(flag) add_library(${SENSOR_NAME} SHARED gyro_sensor.cpp ) -add_library(${SENSOR_HAL_NAME} SHARED - gyro_sensor_hal.cpp - ) target_link_libraries(${SENSOR_NAME} ${gyro_pkgs_LDFLAGS} "-lm") -target_link_libraries(${SENSOR_HAL_NAME} ${gyro_pkgs_LDFLAGS}) install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) -install(TARGETS ${SENSOR_HAL_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/plugins/gyro/gyro_sensor_hal.cpp b/src/plugins/gyro/gyro_sensor_hal.cpp deleted file mode 100755 index 97a6903..0000000 --- a/src/plugins/gyro/gyro_sensor_hal.cpp +++ /dev/null @@ -1,306 +0,0 @@ -/* - * gyro_sensor_hal - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#include -#include -#include -#include -#include -#include -#include -#include - -using std::ifstream; -using std::string; - -#define DPS_TO_MDPS 1000 -#define MIN_RANGE(RES) (-((1 << (RES))/2)) -#define MAX_RANGE(RES) (((1 << (RES))/2)-1) -#define RAW_DATA_TO_DPS_UNIT(X) ((float)(X)/((float)DPS_TO_MDPS)) - -#define SENSOR_TYPE_GYRO "GYRO" -#define ELEMENT_NAME "NAME" -#define ELEMENT_VENDOR "VENDOR" -#define ELEMENT_RAW_DATA_UNIT "RAW_DATA_UNIT" -#define ELEMENT_RESOLUTION "RESOLUTION" - -#define ATTR_VALUE "value" - -gyro_sensor_hal::gyro_sensor_hal() -: m_x(-1) -, m_y(-1) -, m_z(-1) -, m_node_handle(-1) -, m_polling_interval(POLL_1HZ_MS) -, m_fired_time(0) -{ - - const string sensorhub_interval_node_name = "gyro_poll_delay"; - csensor_config &config = csensor_config::get_instance(); - - node_info_query query; - node_info info; - - if (!find_model_id(SENSOR_TYPE_GYRO, m_model_id)) { - ERR("Failed to find model id"); - throw ENXIO; - - } - - query.sensorhub_controlled = m_sensorhub_controlled = is_sensorhub_controlled(sensorhub_interval_node_name); - query.sensor_type = SENSOR_TYPE_GYRO; - query.key = "gyro_sensor"; - query.iio_enable_node_name = "gyro_enable"; - query.sensorhub_interval_node_name = sensorhub_interval_node_name; - - if (!get_node_info(query, info)) { - ERR("Failed to get node info"); - throw ENXIO; - } - - show_node_info(info); - - m_data_node = info.data_node_path; - m_enable_node = info.enable_node_path; - m_interval_node = info.interval_node_path; - - if (!config.get(SENSOR_TYPE_GYRO, m_model_id, ELEMENT_VENDOR, m_vendor)) { - ERR("[VENDOR] is empty\n"); - throw ENXIO; - } - - INFO("m_vendor = %s", m_vendor.c_str()); - - if (!config.get(SENSOR_TYPE_GYRO, m_model_id, ELEMENT_NAME, m_chip_name)) { - ERR("[NAME] is empty\n"); - throw ENXIO; - } - - INFO("m_chip_name = %s\n",m_chip_name.c_str()); - - long resolution; - - if (!config.get(SENSOR_TYPE_GYRO, m_model_id, ELEMENT_RESOLUTION, resolution)) { - ERR("[RESOLUTION] is empty\n"); - throw ENXIO; - } - - m_resolution = (int)resolution; - - double raw_data_unit; - - if (!config.get(SENSOR_TYPE_GYRO, m_model_id, ELEMENT_RAW_DATA_UNIT, raw_data_unit)) { - ERR("[RAW_DATA_UNIT] is empty\n"); - throw ENXIO; - } - - m_raw_data_unit = (float)(raw_data_unit); - - if ((m_node_handle = open(m_data_node.c_str(), O_RDWR)) < 0) { - ERR("gyro handle open fail for gyro processor, error:%s\n", strerror(errno)); - throw ENXIO; - } - - int clockId = CLOCK_MONOTONIC; - if (ioctl(m_node_handle, EVIOCSCLOCKID, &clockId) != 0) - ERR("Fail to set monotonic timestamp for %s", m_data_node.c_str()); - - INFO("m_raw_data_unit = %f\n",m_raw_data_unit); - INFO("RAW_DATA_TO_DPS_UNIT(m_raw_data_unit) = [%f]",RAW_DATA_TO_DPS_UNIT(m_raw_data_unit)); - INFO("gyro_sensor is created!\n"); -} - -gyro_sensor_hal::~gyro_sensor_hal() -{ - close(m_node_handle); - m_node_handle = -1; - - INFO("gyro_sensor is destroyed!\n"); -} - -string gyro_sensor_hal::get_model_id(void) -{ - return m_model_id; -} - -sensor_hal_type_t gyro_sensor_hal::get_type(void) -{ - return SENSOR_HAL_TYPE_GYROSCOPE; -} - -bool gyro_sensor_hal::enable(void) -{ - AUTOLOCK(m_mutex); - - set_enable_node(m_enable_node, m_sensorhub_controlled, true, SENSORHUB_GYROSCOPE_ENABLE_BIT); - set_interval(m_polling_interval); - - m_fired_time = 0; - INFO("Gyro sensor real starting"); - return true; -} - -bool gyro_sensor_hal::disable(void) -{ - AUTOLOCK(m_mutex); - - set_enable_node(m_enable_node, m_sensorhub_controlled, false, SENSORHUB_GYROSCOPE_ENABLE_BIT); - - INFO("Gyro sensor real stopping"); - return true; - -} - -bool gyro_sensor_hal::set_interval(unsigned long val) -{ - unsigned long long polling_interval_ns; - - AUTOLOCK(m_mutex); - - polling_interval_ns = ((unsigned long long)(val) * 1000llu * 1000llu); - - if (!set_node_value(m_interval_node, polling_interval_ns)) { - ERR("Failed to set polling resource: %s\n", m_interval_node.c_str()); - return false; - } - - INFO("Interval is changed from %dms to %dms]", m_polling_interval, val); - m_polling_interval = val; - return true; -} - - -bool gyro_sensor_hal::update_value(bool wait) -{ - int gyro_raw[3] = {0,}; - bool x,y,z; - int read_input_cnt = 0; - const int INPUT_MAX_BEFORE_SYN = 10; - unsigned long long fired_time = 0; - bool syn = false; - - x = y = z = false; - - struct input_event gyro_input; - DBG("gyro event detection!"); - - while ((syn == false) && (read_input_cnt < INPUT_MAX_BEFORE_SYN)) { - int len = read(m_node_handle, &gyro_input, sizeof(gyro_input)); - if (len != sizeof(gyro_input)) { - ERR("gyro_file read fail, read_len = %d\n, %s",len, strerror(errno)); - return false; - } - - ++read_input_cnt; - - if (gyro_input.type == EV_REL) { - switch (gyro_input.code) { - case REL_RX: - gyro_raw[0] = (int)gyro_input.value; - x = true; - break; - case REL_RY: - gyro_raw[1] = (int)gyro_input.value; - y = true; - break; - case REL_RZ: - gyro_raw[2] = (int)gyro_input.value; - z = true; - break; - default: - ERR("gyro_input event[type = %d, code = %d] is unknown.", gyro_input.type, gyro_input.code); - return false; - break; - } - } else if (gyro_input.type == EV_SYN) { - syn = true; - fired_time = sensor_hal::get_timestamp(&gyro_input.time); - } else { - ERR("gyro_input event[type = %d, code = %d] is unknown.", gyro_input.type, gyro_input.code); - return false; - } - } - - AUTOLOCK(m_value_mutex); - - if (x) - m_x = gyro_raw[0]; - if (y) - m_y = gyro_raw[1]; - if (z) - m_z = gyro_raw[2]; - - m_fired_time = fired_time; - - DBG("m_x = %d, m_y = %d, m_z = %d, time = %lluus", m_x, m_y, m_z, m_fired_time); - - return true; -} - -bool gyro_sensor_hal::is_data_ready(bool wait) -{ - bool ret; - ret = update_value(wait); - return ret; -} - -int gyro_sensor_hal::get_sensor_data(sensor_data_t &data) -{ - AUTOLOCK(m_value_mutex); - - data.accuracy = SENSOR_ACCURACY_GOOD; - data.timestamp = m_fired_time ; - data.value_count = 3; - data.values[0] = m_x; - data.values[1] = m_y; - data.values[2] = m_z; - - return 0; -} - -bool gyro_sensor_hal::get_properties(sensor_properties_s &properties) -{ - properties.name = m_chip_name; - properties.vendor = m_vendor; - properties.min_range = MIN_RANGE(m_resolution)* RAW_DATA_TO_DPS_UNIT(m_raw_data_unit); - properties.max_range = MAX_RANGE(m_resolution)* RAW_DATA_TO_DPS_UNIT(m_raw_data_unit); - properties.min_interval = 1; - properties.resolution = RAW_DATA_TO_DPS_UNIT(m_raw_data_unit); - properties.fifo_count = 0; - properties.max_batch_count = 0; - return true; - -} - -extern "C" sensor_module* create(void) -{ - gyro_sensor_hal *sensor; - - try { - sensor = new(std::nothrow) gyro_sensor_hal; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/plugins/gyro/gyro_sensor_hal.h b/src/plugins/gyro/gyro_sensor_hal.h deleted file mode 100755 index dde408e..0000000 --- a/src/plugins/gyro/gyro_sensor_hal.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * gyro_sensor_hal - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef _GYRO_SENSOR_HAL_H_ -#define _GYRO_SENSOR_HAL_H_ - -#include - -class gyro_sensor_hal : public sensor_hal -{ -public: - gyro_sensor_hal(); - virtual ~gyro_sensor_hal(); - std::string get_model_id(void); - sensor_hal_type_t get_type(void); - bool enable(void); - bool disable(void); - bool set_interval(unsigned long ms_interval); - bool is_data_ready(bool wait); - virtual int get_sensor_data(sensor_data_t &data); - virtual bool get_properties(sensor_properties_s &properties); - -private: - int m_x; - int m_y; - int m_z; - int m_node_handle; - unsigned long m_polling_interval; - unsigned long long m_fired_time; - - std::string m_model_id; - std::string m_vendor; - std::string m_chip_name; - - float m_min_range; - float m_max_range; - int m_resolution; - float m_raw_data_unit; - - std::string m_data_node; - std::string m_enable_node; - std::string m_interval_node; - - bool m_sensorhub_controlled; - - cmutex m_value_mutex; - - bool update_value(bool wait); -}; -#endif /*_GYRO_SENSOR_HAL_CLASS_H_*/ diff --git a/src/plugins/light/CMakeLists.txt b/src/plugins/light/CMakeLists.txt index 9945df2..71ffd6a 100755 --- a/src/plugins/light/CMakeLists.txt +++ b/src/plugins/light/CMakeLists.txt @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 2.6) project(light CXX) SET(SENSOR_NAME light_sensor) -SET(SENSOR_HAL_NAME light_sensor_hal) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) @@ -19,12 +18,6 @@ add_library(${SENSOR_NAME} SHARED light_sensor.cpp ) -add_library(${SENSOR_HAL_NAME} SHARED - light_sensor_hal.cpp - ) - target_link_libraries(${SENSOR_NAME} ${light_pkgs_LDFLAGS} "-lm") -target_link_libraries(${SENSOR_HAL_NAME} ${light_pkgs_LDFLAGS}) install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) -install(TARGETS ${SENSOR_HAL_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/plugins/light/light_sensor_hal.cpp b/src/plugins/light/light_sensor_hal.cpp deleted file mode 100755 index bf3a613..0000000 --- a/src/plugins/light/light_sensor_hal.cpp +++ /dev/null @@ -1,248 +0,0 @@ -/* - * light_sensor_hal - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#include -#include -#include -#include -#include -#include -#include -#include - -using std::ifstream; -using std::string; - -#define SENSOR_TYPE_LIGHT "LIGHT" -#define ELEMENT_NAME "NAME" -#define ELEMENT_VENDOR "VENDOR" -#define ELEMENT_RAW_DATA_UNIT "RAW_DATA_UNIT" -#define ELEMENT_RESOLUTION "RESOLUTION" -#define ATTR_VALUE "value" -#define INITIAL_TIME -1 -#define BIAS 1 -#define INVALID_VALUE -1 -#define INITIAL_VALUE -1 - -light_sensor_hal::light_sensor_hal() -: m_polling_interval(POLL_1HZ_MS) -, m_adc(INVALID_VALUE) -, m_fired_time(INITIAL_TIME) -, m_node_handle(INITIAL_VALUE) -{ - const string sensorhub_interval_node_name = "light_poll_delay"; - csensor_config &config = csensor_config::get_instance(); - - node_info_query query; - node_info info; - - if (!find_model_id(SENSOR_TYPE_LIGHT, m_model_id)) { - ERR("Failed to find model id"); - throw ENXIO; - - } - - query.sensorhub_controlled = m_sensorhub_controlled = is_sensorhub_controlled(sensorhub_interval_node_name); - query.sensor_type = SENSOR_TYPE_LIGHT; - query.key = "light_sensor"; - query.iio_enable_node_name = "light_enable"; - query.sensorhub_interval_node_name = sensorhub_interval_node_name; - - if (!get_node_info(query, info)) { - ERR("Failed to get node info"); - throw ENXIO; - } - - show_node_info(info); - - m_data_node = info.data_node_path; - m_enable_node = info.enable_node_path; - m_interval_node = info.interval_node_path; - - if (!config.get(SENSOR_TYPE_LIGHT, m_model_id, ELEMENT_VENDOR, m_vendor)) { - ERR("[VENDOR] is empty\n"); - throw ENXIO; - } - - INFO("m_vendor = %s", m_vendor.c_str()); - - if (!config.get(SENSOR_TYPE_LIGHT, m_model_id, ELEMENT_NAME, m_chip_name)) { - ERR("[NAME] is empty\n"); - throw ENXIO; - } - - INFO("m_chip_name = %s\n",m_chip_name.c_str()); - - if ((m_node_handle = open(m_data_node.c_str(),O_RDWR)) < 0) { - ERR("Failed to open handle(%d)", m_node_handle); - throw ENXIO; - } - - int clockId = CLOCK_MONOTONIC; - if (ioctl(m_node_handle, EVIOCSCLOCKID, &clockId) != 0) - ERR("Fail to set monotonic timestamp for %s", m_data_node.c_str()); - - INFO("light_sensor_hal is created!\n"); - -} - -light_sensor_hal::~light_sensor_hal() -{ - close(m_node_handle); - m_node_handle = -1; - - INFO("light_sensor_hal is destroyed!\n"); -} - -string light_sensor_hal::get_model_id(void) -{ - return m_model_id; -} - - -sensor_hal_type_t light_sensor_hal::get_type(void) -{ - return SENSOR_HAL_TYPE_LIGHT; -} - -bool light_sensor_hal::enable(void) -{ - AUTOLOCK(m_mutex); - - set_enable_node(m_enable_node, m_sensorhub_controlled, true, SENSORHUB_LIGHT_ENABLE_BIT); - set_interval(m_polling_interval); - - m_fired_time = 0; - INFO("Light sensor real starting"); - return true; -} - -bool light_sensor_hal::disable(void) -{ - AUTOLOCK(m_mutex); - - set_enable_node(m_enable_node, m_sensorhub_controlled, false, SENSORHUB_LIGHT_ENABLE_BIT); - - INFO("Light sensor real stopping"); - return true; -} - -bool light_sensor_hal::set_interval(unsigned long val) -{ - unsigned long long polling_interval_ns; - - AUTOLOCK(m_mutex); - - polling_interval_ns = ((unsigned long long)(val) * 1000llu * 1000llu); - - if (!set_node_value(m_interval_node, polling_interval_ns)) { - ERR("Failed to set polling resource: %s\n", m_interval_node.c_str()); - return false; - } - - INFO("Interval is changed from %dms to %dms]", m_polling_interval, val); - m_polling_interval = val; - return true; -} - - -bool light_sensor_hal::update_value(bool wait) -{ - unsigned short int adc = INITIAL_VALUE; - - struct input_event light_event; - DBG("light event detection!"); - - int len = read(m_node_handle, &light_event, sizeof(light_event)); - if (len == -1) { - DBG("read(m_node_handle) is error:%s.\n", strerror(errno)); - return false; - } - - if (light_event.type == EV_ABS && light_event.code == ABS_MISC) { - adc = light_event.value; - } else if (light_event.type == EV_REL && light_event.code == REL_MISC) { - adc = light_event.value - BIAS; - } else if (light_event.type == EV_REL && light_event.code == REL_RX) { - adc = light_event.value - BIAS; - } else { - DBG("light input event[type = %d, code = %d] is unknown.", light_event.type, light_event.code); - return false; - } - - DBG("read event, len : %d, type : %x, code : %x, value : %x", - len, light_event.type, light_event.code, light_event.value); - - DBG("update_value, adc : %d", adc); - - AUTOLOCK(m_value_mutex); - m_adc = adc; - m_fired_time = get_timestamp(&light_event.time); - - return true; -} - -bool light_sensor_hal::is_data_ready(bool wait) -{ - bool ret; - ret = update_value(wait); - return ret; -} - -int light_sensor_hal::get_sensor_data(sensor_data_t &data) -{ - AUTOLOCK(m_value_mutex); - data.accuracy = SENSOR_ACCURACY_GOOD; - data.timestamp = m_fired_time; - data.value_count = 1; - data.values[0] = (float) m_adc; - - return 0; -} - - -bool light_sensor_hal::get_properties(sensor_properties_s &properties) -{ - properties.name = m_chip_name; - properties.vendor = m_vendor; - properties.min_range = 0; - properties.max_range = 65535; - properties.min_interval = 1; - properties.resolution = 1; - properties.fifo_count = 0; - properties.max_batch_count = 0; - return true; -} - -extern "C" sensor_module* create(void) -{ - light_sensor_hal *sensor; - - try { - sensor = new(std::nothrow) light_sensor_hal; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/plugins/light/light_sensor_hal.h b/src/plugins/light/light_sensor_hal.h deleted file mode 100755 index 560cb87..0000000 --- a/src/plugins/light/light_sensor_hal.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * light_sensor_hal - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef _LIGHT_SENSOR_HAL_H_ -#define _LIGHT_SENSOR_HAL_H_ - -#include - -class light_sensor_hal : public sensor_hal -{ -public: - light_sensor_hal(); - virtual ~light_sensor_hal(); - std::string get_model_id(void); - sensor_hal_type_t get_type(void); - bool enable(void); - bool disable(void); - bool set_interval(unsigned long val); - bool is_data_ready(bool wait); - virtual int get_sensor_data(sensor_data_t &data); - bool get_properties(sensor_properties_s &properties); -private: - std::string m_model_id; - std::string m_vendor; - std::string m_chip_name; - - unsigned long m_polling_interval; - - int m_adc; - - unsigned long long m_fired_time; - int m_node_handle; - - std::string m_enable_node; - std::string m_data_node; - std::string m_interval_node; - - bool m_sensorhub_controlled; - - cmutex m_value_mutex; - - bool update_value(bool wait); -}; -#endif /*_GYRO_SENSOR_HAL_CLASS_H_*/ diff --git a/src/plugins/pressure/CMakeLists.txt b/src/plugins/pressure/CMakeLists.txt index 85a8e9b..db0c209 100755 --- a/src/plugins/pressure/CMakeLists.txt +++ b/src/plugins/pressure/CMakeLists.txt @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 2.6) project(pressure CXX) SET(SENSOR_NAME pressure_sensor) -SET(SENSOR_HAL_NAME pressure_sensor_hal) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) @@ -19,12 +18,6 @@ add_library(${SENSOR_NAME} SHARED pressure_sensor.cpp ) -add_library(${SENSOR_HAL_NAME} SHARED - pressure_sensor_hal.cpp - ) - target_link_libraries(${SENSOR_NAME} ${pressure_pkgs_LDFLAGS} "-lm") -target_link_libraries(${SENSOR_HAL_NAME} ${pressure_pkgs_LDFLAGS}) install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) -install(TARGETS ${SENSOR_HAL_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/plugins/pressure/pressure_sensor_hal.cpp b/src/plugins/pressure/pressure_sensor_hal.cpp deleted file mode 100755 index 544240f..0000000 --- a/src/plugins/pressure/pressure_sensor_hal.cpp +++ /dev/null @@ -1,321 +0,0 @@ -/* - * pressure_sensor_hal - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#include -#include -#include -#include -#include -#include -#include -#include - -using std::ifstream; -using std::string; - -#define SENSOR_TYPE_PRESSURE "PRESSURE" -#define ELEMENT_NAME "NAME" -#define ELEMENT_VENDOR "VENDOR" -#define ELEMENT_RAW_DATA_UNIT "RAW_DATA_UNIT" -#define ELEMENT_RESOLUTION "RESOLUTION" -#define ELEMENT_MIN_RANGE "MIN_RANGE" -#define ELEMENT_MAX_RANGE "MAX_RANGE" -#define ELEMENT_TEMPERATURE_RESOLUTION "TEMPERATURE_RESOLUTION" -#define ELEMENT_TEMPERATURE_OFFSET "TEMPERATURE_OFFSET" -#define ATTR_VALUE "value" - -#define SEA_LEVEL_PRESSURE 101325.0 - -pressure_sensor_hal::pressure_sensor_hal() -: m_pressure(0) -, m_sea_level_pressure(SEA_LEVEL_PRESSURE) -, m_temperature(0) -, m_polling_interval(POLL_1HZ_MS) -, m_fired_time(0) -, m_node_handle(-1) -{ - const string sensorhub_interval_node_name = "pressure_poll_delay"; - csensor_config &config = csensor_config::get_instance(); - - node_info_query query; - node_info info; - - if (!find_model_id(SENSOR_TYPE_PRESSURE, m_model_id)) { - ERR("Failed to find model id"); - throw ENXIO; - - } - - query.sensorhub_controlled = m_sensorhub_controlled = is_sensorhub_controlled(sensorhub_interval_node_name); - query.sensor_type = SENSOR_TYPE_PRESSURE; - query.key = "pressure_sensor"; - query.iio_enable_node_name = "pressure_enable"; - query.sensorhub_interval_node_name = sensorhub_interval_node_name; - - bool error = get_node_info(query, info); - - query.key = "barometer_sensor"; - error |= get_node_info(query, info); - - if (!error) { - ERR("Failed to get node info"); - throw ENXIO; - } - - show_node_info(info); - - m_data_node = info.data_node_path; - m_enable_node = info.enable_node_path; - m_interval_node = info.interval_node_path; - - if (!config.get(SENSOR_TYPE_PRESSURE, m_model_id, ELEMENT_VENDOR, m_vendor)) { - ERR("[VENDOR] is empty\n"); - throw ENXIO; - } - - INFO("m_vendor = %s", m_vendor.c_str()); - - if (!config.get(SENSOR_TYPE_PRESSURE, m_model_id, ELEMENT_NAME, m_chip_name)) { - ERR("[NAME] is empty\n"); - throw ENXIO; - } - - INFO("m_chip_name = %s", m_chip_name.c_str()); - - double min_range; - - if (!config.get(SENSOR_TYPE_PRESSURE, m_model_id, ELEMENT_MIN_RANGE, min_range)) { - ERR("[MIN_RANGE] is empty\n"); - throw ENXIO; - } - - m_min_range = (float)min_range; - INFO("m_min_range = %f\n",m_min_range); - - double max_range; - - if (!config.get(SENSOR_TYPE_PRESSURE, m_model_id, ELEMENT_MAX_RANGE, max_range)) { - ERR("[MAX_RANGE] is empty\n"); - throw ENXIO; - } - - m_max_range = (float)max_range; - INFO("m_max_range = %f\n",m_max_range); - - double raw_data_unit; - - if (!config.get(SENSOR_TYPE_PRESSURE, m_model_id, ELEMENT_RAW_DATA_UNIT, raw_data_unit)) { - ERR("[RAW_DATA_UNIT] is empty\n"); - throw ENXIO; - } - - m_raw_data_unit = (float)(raw_data_unit); - INFO("m_raw_data_unit = %f\n", m_raw_data_unit); - - if ((m_node_handle = open(m_data_node.c_str(),O_RDWR)) < 0) { - ERR("Failed to open handle(%d)", m_node_handle); - throw ENXIO; - } - - int clockId = CLOCK_MONOTONIC; - if (ioctl(m_node_handle, EVIOCSCLOCKID, &clockId) != 0) - ERR("Fail to set monotonic timestamp for %s", m_data_node.c_str()); - - INFO("pressure_sensor_hal is created!\n"); -} - -pressure_sensor_hal::~pressure_sensor_hal() -{ - close(m_node_handle); - m_node_handle = -1; - - INFO("pressure_sensor_hal is destroyed!\n"); -} - -string pressure_sensor_hal::get_model_id(void) -{ - return m_model_id; -} - -sensor_hal_type_t pressure_sensor_hal::get_type(void) -{ - return SENSOR_HAL_TYPE_PRESSURE; -} - -bool pressure_sensor_hal::enable(void) -{ - AUTOLOCK(m_mutex); - - set_enable_node(m_enable_node, m_sensorhub_controlled, true, SENSORHUB_PRESSURE_ENABLE_BIT); - - set_interval(m_polling_interval); - - m_fired_time = 0; - INFO("Pressure sensor real starting"); - return true; -} - -bool pressure_sensor_hal::disable(void) -{ - AUTOLOCK(m_mutex); - - set_enable_node(m_enable_node, m_sensorhub_controlled, false, SENSORHUB_PRESSURE_ENABLE_BIT); - - INFO("Pressure sensor real stopping"); - return true; -} - -bool pressure_sensor_hal::set_interval(unsigned long val) -{ - unsigned long long polling_interval_ns; - - AUTOLOCK(m_mutex); - - polling_interval_ns = ((unsigned long long)(val) * 1000llu * 1000llu); - - if (!set_node_value(m_interval_node, polling_interval_ns)) { - ERR("Failed to set polling resource: %s\n", m_interval_node.c_str()); - return false; - } - - INFO("Interval is changed from %dms to %dms]", m_polling_interval, val); - m_polling_interval = val; - return true; -} - -bool pressure_sensor_hal::update_value(bool wait) -{ - int pressure_raw[3] = {0,}; - bool pressure = false; - bool sea_level = false; - bool temperature = false; - int read_input_cnt = 0; - const int INPUT_MAX_BEFORE_SYN = 10; - unsigned long long fired_time = 0; - bool syn = false; - - struct input_event pressure_event; - DBG("pressure event detection!"); - - while ((syn == false) && (read_input_cnt < INPUT_MAX_BEFORE_SYN)) { - int len = read(m_node_handle, &pressure_event, sizeof(pressure_event)); - if (len != sizeof(pressure_event)) { - ERR("pressure_file read fail, read_len = %d\n",len); - return false; - } - - ++read_input_cnt; - - if (pressure_event.type == EV_REL) { - switch (pressure_event.code) { - case REL_X: - case REL_HWHEEL: - pressure_raw[0] = (int)pressure_event.value; - pressure = true; - break; - case REL_Y: - case REL_DIAL: - pressure_raw[1] = (int)pressure_event.value; - sea_level = true; - break; - case REL_Z: - case REL_WHEEL: - pressure_raw[2] = (int)pressure_event.value; - temperature = true; - break; - default: - ERR("pressure_event event[type = %d, code = %d] is unknown.", pressure_event.type, pressure_event.code); - return false; - break; - } - } else if (pressure_event.type == EV_SYN) { - syn = true; - fired_time = sensor_hal::get_timestamp(&pressure_event.time); - } else { - ERR("pressure_event event[type = %d, code = %d] is unknown.", pressure_event.type, pressure_event.code); - return false; - } - } - - AUTOLOCK(m_value_mutex); - - if (pressure) - m_pressure = pressure_raw[0]; - if (sea_level) - m_sea_level_pressure = pressure_raw[1]; - if (temperature) - m_temperature = pressure_raw[2]; - - m_fired_time = fired_time; - - DBG("m_pressure = %d, sea_level = %d, temperature = %d, time = %lluus", m_pressure, m_sea_level_pressure, m_temperature, m_fired_time); - - return true; -} - -bool pressure_sensor_hal::is_data_ready(bool wait) -{ - bool ret; - ret = update_value(wait); - return ret; -} - -int pressure_sensor_hal::get_sensor_data(sensor_data_t &data) -{ - AUTOLOCK(m_value_mutex); - data.accuracy = SENSOR_ACCURACY_GOOD; - data.timestamp = m_fired_time ; - data.value_count = 3; - data.values[0] = m_pressure; - data.values[1] = m_sea_level_pressure; - data.values[2] = m_temperature; - - return 0; -} - - -bool pressure_sensor_hal::get_properties(sensor_properties_s &properties) -{ - properties.name = m_chip_name; - properties.vendor = m_vendor; - properties.min_range = m_min_range; - properties.max_range = m_max_range; - properties.min_interval = 1; - properties.resolution = m_raw_data_unit; - properties.fifo_count = 0; - properties.max_batch_count = 0; - return true; -} - -extern "C" sensor_module* create(void) -{ - pressure_sensor_hal *sensor; - - try { - sensor = new(std::nothrow) pressure_sensor_hal; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/plugins/pressure/pressure_sensor_hal.h b/src/plugins/pressure/pressure_sensor_hal.h deleted file mode 100755 index 07e8e1b..0000000 --- a/src/plugins/pressure/pressure_sensor_hal.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * pressure_sensor_hal - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef _PRESSURE_SENSOR_HAL_H_ -#define _PRESSURE_SENSOR_HAL_H_ - -#include - -class pressure_sensor_hal : public sensor_hal -{ -public: - pressure_sensor_hal(); - virtual ~pressure_sensor_hal(); - std::string get_model_id(void); - sensor_hal_type_t get_type(void); - - bool enable(void); - bool disable(void); - bool set_interval(unsigned long val); - bool is_data_ready(bool wait); - virtual int get_sensor_data(sensor_data_t &data); - virtual bool get_properties(sensor_properties_s &properties); -private: - std::string m_model_id; - std::string m_vendor; - std::string m_chip_name; - - float m_pressure; - float m_sea_level_pressure; - float m_temperature; - - int m_resolution; - - float m_min_range; - float m_max_range; - float m_raw_data_unit; - float m_temp_resolution; - float m_temp_offset; - unsigned long m_polling_interval; - - unsigned long long m_fired_time; - int m_node_handle; - - std::string m_enable_node; - std::string m_data_node; - std::string m_interval_node; - - bool m_sensorhub_controlled; - - cmutex m_value_mutex; - - bool update_value(bool wait); -}; -#endif /*_PRESSURE_SENSOR_HAL_CLASS_H_*/ diff --git a/src/plugins/proxi/CMakeLists.txt b/src/plugins/proxi/CMakeLists.txt index bed7b2d..7cd377e 100755 --- a/src/plugins/proxi/CMakeLists.txt +++ b/src/plugins/proxi/CMakeLists.txt @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 2.6) project(proxi CXX) SET(SENSOR_NAME proxi_sensor) -SET(SENSOR_HAL_NAME proxi_sensor_hal) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) @@ -19,12 +18,6 @@ add_library(${SENSOR_NAME} SHARED proxi_sensor.cpp ) -add_library(${SENSOR_HAL_NAME} SHARED - proxi_sensor_hal.cpp -) - target_link_libraries(${SENSOR_NAME} ${proxi_pkgs_LDFLAGS} "-lm") -target_link_libraries(${SENSOR_HAL_NAME} ${proxi_pkgs_LDFLAGS}) install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) -install(TARGETS ${SENSOR_HAL_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/plugins/proxi/proxi_sensor_hal.cpp b/src/plugins/proxi/proxi_sensor_hal.cpp deleted file mode 100755 index 0d82907..0000000 --- a/src/plugins/proxi/proxi_sensor_hal.cpp +++ /dev/null @@ -1,207 +0,0 @@ -/* - * proxi_sensor_hal - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#include -#include -#include -#include -#include -#include -#include -#include - -using std::string; -using std::ifstream; - -#define SENSOR_TYPE_PROXI "PROXI" -#define ELEMENT_NAME "NAME" -#define ELEMENT_VENDOR "VENDOR" -#define ATTR_VALUE "value" - -#define PROXI_CODE 0x0019 - -proxi_sensor_hal::proxi_sensor_hal() -: m_state(-1) -, m_fired_time(0) -, m_node_handle(-1) -{ - const string sensorhub_interval_node_name = "prox_poll_delay"; - csensor_config &config = csensor_config::get_instance(); - - node_info_query query; - node_info info; - - if (!find_model_id(SENSOR_TYPE_PROXI, m_model_id)) { - ERR("Failed to find model id"); - throw ENXIO; - - } - - query.sensorhub_controlled = m_sensorhub_controlled = is_sensorhub_controlled(sensorhub_interval_node_name); - query.sensor_type = SENSOR_TYPE_PROXI; - query.key = "proximity_sensor"; - query.iio_enable_node_name = "proximity_enable"; - query.sensorhub_interval_node_name = sensorhub_interval_node_name; - - if (!get_node_info(query, info)) { - ERR("Failed to get node info"); - throw ENXIO; - } - - show_node_info(info); - - m_data_node = info.data_node_path; - m_enable_node = info.enable_node_path; - - if (!config.get(SENSOR_TYPE_PROXI, m_model_id, ELEMENT_VENDOR, m_vendor)) { - ERR("[VENDOR] is empty\n"); - throw ENXIO; - } - - INFO("m_vendor = %s", m_vendor.c_str()); - - if (!config.get(SENSOR_TYPE_PROXI, m_model_id, ELEMENT_NAME, m_chip_name)) { - ERR("[NAME] is empty\n"); - throw ENXIO; - } - - INFO("m_chip_name = %s\n",m_chip_name.c_str()); - - if ((m_node_handle = open(m_data_node.c_str(), O_RDWR)) < 0) { - ERR("Proxi handle(%d) open fail", m_node_handle); - throw ENXIO; - } - - int clockId = CLOCK_MONOTONIC; - if (ioctl(m_node_handle, EVIOCSCLOCKID, &clockId) != 0) - ERR("Fail to set monotonic timestamp for %s", m_data_node.c_str()); - - INFO("Proxi_sensor_hal is created!\n"); - -} - -proxi_sensor_hal::~proxi_sensor_hal() -{ - close(m_node_handle); - m_node_handle = -1; - - INFO("Proxi_sensor_hal is destroyed!\n"); -} - -string proxi_sensor_hal::get_model_id(void) -{ - return m_model_id; -} - -sensor_hal_type_t proxi_sensor_hal::get_type(void) -{ - return SENSOR_HAL_TYPE_PROXIMITY; -} - -bool proxi_sensor_hal::enable(void) -{ - AUTOLOCK(m_mutex); - - set_enable_node(m_enable_node, m_sensorhub_controlled, true, SENSORHUB_PROXIMITY_ENABLE_BIT); - - m_fired_time = 0; - INFO("Proxi sensor real starting"); - return true; -} - -bool proxi_sensor_hal::disable(void) -{ - AUTOLOCK(m_mutex); - - set_enable_node(m_enable_node, m_sensorhub_controlled, false, SENSORHUB_PROXIMITY_ENABLE_BIT); - - INFO("Proxi sensor real stopping"); - return true; -} - -bool proxi_sensor_hal::update_value(bool wait) -{ - struct input_event proxi_event; - INFO("proxi event detection!"); - - int len = read(m_node_handle, &proxi_event, sizeof(proxi_event)); - - if (len == -1) { - DBG("read(m_node_handle) is error:%s.\n", strerror(errno)); - return false; - } - - DBG("read event, len : %d , type : %x , code : %x , value : %x", len, proxi_event.type, proxi_event.code, proxi_event.value); - if ((proxi_event.type == EV_ABS) && (proxi_event.code == PROXI_CODE)) { - AUTOLOCK(m_value_mutex); - m_state = proxi_event.value; - m_fired_time = sensor_hal::get_timestamp(&proxi_event.time); - } else { - return false; - } - return true; -} - -bool proxi_sensor_hal::is_data_ready(bool wait) -{ - bool ret; - ret = update_value(wait); - return ret; -} - -int proxi_sensor_hal::get_sensor_data(sensor_data_t &data) -{ - AUTOLOCK(m_value_mutex); - data.accuracy = SENSOR_ACCURACY_UNDEFINED; - data.timestamp = m_fired_time; - data.value_count = 1; - data.values[0] = m_state; - - return 0; -} - -bool proxi_sensor_hal::get_properties(sensor_properties_s &properties) -{ - properties.name = m_chip_name; - properties.vendor = m_vendor; - properties.min_range = 0; - properties.max_range = 1; - properties.min_interval = 1; - properties.resolution = 1; - properties.fifo_count = 0; - properties.max_batch_count = 0; - return true; -} - -extern "C" sensor_module* create(void) -{ - proxi_sensor_hal *sensor; - - try { - sensor = new(std::nothrow) proxi_sensor_hal; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/plugins/proxi/proxi_sensor_hal.h b/src/plugins/proxi/proxi_sensor_hal.h deleted file mode 100755 index d906ed6..0000000 --- a/src/plugins/proxi/proxi_sensor_hal.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * proxi_sensor_hal - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef _PROXI_SENSOR_HAL_H_ -#define _PROXI_SENSOR_HAL_H_ - -#include - -class proxi_sensor_hal : public sensor_hal -{ -public: - proxi_sensor_hal(); - virtual ~proxi_sensor_hal(); - std::string get_model_id(void); - sensor_hal_type_t get_type(void); - bool enable(void); - bool disable(void); - bool is_data_ready(bool wait); - virtual int get_sensor_data(sensor_data_t &data); - virtual bool get_properties(sensor_properties_s &properties); -private: - std::string m_model_id; - std::string m_vendor; - std::string m_chip_name; - - std::string m_enable_node; - std::string m_data_node; - - unsigned int m_state; - - unsigned long long m_fired_time; - - int m_node_handle; - bool m_sensorhub_controlled; - cmutex m_value_mutex; - - bool update_value(bool wait); -}; -#endif /*_PROXI_SENSOR_HAL_H_*/ diff --git a/src/plugins/rotation_vector/rv_raw/CMakeLists.txt b/src/plugins/rotation_vector/rv_raw/CMakeLists.txt index 223b8c8..99c993f 100755 --- a/src/plugins/rotation_vector/rv_raw/CMakeLists.txt +++ b/src/plugins/rotation_vector/rv_raw/CMakeLists.txt @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 2.6) project(rv_raw CXX) SET(SENSOR_NAME rv_raw_sensor) -SET(SENSOR_HAL_NAME rv_raw_sensor_hal) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) @@ -22,12 +21,6 @@ add_library(${SENSOR_NAME} SHARED rv_raw_sensor.cpp ) -add_library(${SENSOR_HAL_NAME} SHARED - rv_raw_sensor_hal.cpp -) - target_link_libraries(${SENSOR_NAME} ${rv_raw_pkgs_LDFLAGS} "-lm") -target_link_libraries(${SENSOR_HAL_NAME} ${rv_raw_pkgs_LDFLAGS}) install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) -install(TARGETS ${SENSOR_HAL_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/plugins/rotation_vector/rv_raw/rv_raw_sensor_hal.cpp b/src/plugins/rotation_vector/rv_raw/rv_raw_sensor_hal.cpp deleted file mode 100755 index 11eb5c4..0000000 --- a/src/plugins/rotation_vector/rv_raw/rv_raw_sensor_hal.cpp +++ /dev/null @@ -1,289 +0,0 @@ -/* - * rv_raw_sensor_hal - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#include -#include -#include -#include -#include -#include -#include -#include - -using std::ifstream; -using std::string; - -#define SENSOR_TYPE_RV_RAW "ROTATION_VECTOR" -#define ELEMENT_NAME "NAME" -#define ELEMENT_VENDOR "VENDOR" -#define ATTR_VALUE "value" - -rv_raw_sensor_hal::rv_raw_sensor_hal() -: m_quat_a(0) -, m_quat_b(0) -, m_quat_c(0) -, m_quat_d(0) -, m_polling_interval(POLL_1HZ_MS) -{ - const string sensorhub_interval_node_name = "rot_poll_delay"; - csensor_config &config = csensor_config::get_instance(); - - node_info_query query; - node_info info; - - if (!find_model_id(SENSOR_TYPE_RV_RAW, m_model_id)) { - ERR("Failed to find model id"); - throw ENXIO; - - } - - query.sensorhub_controlled = m_sensorhub_controlled = is_sensorhub_controlled(sensorhub_interval_node_name); - query.sensor_type = SENSOR_TYPE_RV_RAW; - query.key = "rot_sensor"; - query.iio_enable_node_name = "rot_enable"; - query.sensorhub_interval_node_name = sensorhub_interval_node_name; - - if (!get_node_info(query, info)) { - ERR("Failed to get node info"); - throw ENXIO; - } - - show_node_info(info); - - m_data_node = info.data_node_path; - m_enable_node = info.enable_node_path; - m_interval_node = info.interval_node_path; - - if (!config.get(SENSOR_TYPE_RV_RAW, m_model_id, ELEMENT_VENDOR, m_vendor)) { - ERR("[VENDOR] is empty\n"); - throw ENXIO; - } - - INFO("m_vendor = %s", m_vendor.c_str()); - - if (!config.get(SENSOR_TYPE_RV_RAW, m_model_id, ELEMENT_NAME, m_chip_name)) { - ERR("[NAME] is empty\n"); - throw ENXIO; - } - - INFO("m_chip_name = %s", m_chip_name.c_str()); - - if ((m_node_handle = open(m_data_node.c_str(),O_RDWR)) < 0) { - ERR("Failed to open handle(%d)", m_node_handle); - throw ENXIO; - } - - int clockId = CLOCK_MONOTONIC; - if (ioctl(m_node_handle, EVIOCSCLOCKID, &clockId) != 0) - ERR("Fail to set monotonic timestamp for %s", m_data_node.c_str()); - - INFO("rv_raw_sensor_hal is created!\n"); - -} - -rv_raw_sensor_hal::~rv_raw_sensor_hal() -{ - close(m_node_handle); - m_node_handle = -1; - - INFO("rv_raw_sensor_hal is destroyed!\n"); -} - -string rv_raw_sensor_hal::get_model_id(void) -{ - return m_model_id; -} - -sensor_hal_type_t rv_raw_sensor_hal::get_type(void) -{ - return SENSOR_HAL_TYPE_RV_RAW; -} - -bool rv_raw_sensor_hal::enable(void) -{ - AUTOLOCK(m_mutex); - - set_enable_node(m_enable_node, m_sensorhub_controlled, true, SENSORHUB_ROTATION_VECTOR_ENABLE_BIT); - set_interval(m_polling_interval); - - m_fired_time = 0; - INFO("Rotation vector raw sensor real starting"); - return true; -} - -bool rv_raw_sensor_hal::disable(void) -{ - AUTOLOCK(m_mutex); - - set_enable_node(m_enable_node, m_sensorhub_controlled, false, SENSORHUB_ROTATION_VECTOR_ENABLE_BIT); - - INFO("Rotation vector raw sensor real stopping"); - return true; -} - -bool rv_raw_sensor_hal::set_interval(unsigned long val) -{ - unsigned long long polling_interval_ns; - - AUTOLOCK(m_mutex); - - polling_interval_ns = ((unsigned long long)(val) * 1000llu * 1000llu); - - if (!set_node_value(m_interval_node, polling_interval_ns)) { - ERR("Failed to set polling resource: %s\n", m_interval_node.c_str()); - return false; - } - - INFO("Interval is changed from %dms to %dms]", m_polling_interval, val); - m_polling_interval = val; - return true; - -} - -bool rv_raw_sensor_hal::update_value(bool wait) -{ - int rot_raw[5] = {0,}; - bool quat_a,quat_b,quat_c,quat_d,acc_rot; - int read_input_cnt = 0; - const int INPUT_MAX_BEFORE_SYN = 10; - unsigned long long fired_time = 0; - bool syn = false; - - quat_a = quat_b = quat_c = quat_d = acc_rot = false; - - struct input_event rot_input; - DBG("geo event detection!"); - - while ((syn == false) && (read_input_cnt < INPUT_MAX_BEFORE_SYN)) { - int len = read(m_node_handle, &rot_input, sizeof(rot_input)); - if (len != sizeof(rot_input)) { - ERR("rot_file read fail, read_len = %d\n",len); - return false; - } - - ++read_input_cnt; - - if (rot_input.type == EV_REL) { - switch (rot_input.code) { - case REL_X: - rot_raw[0] = (int)rot_input.value; - quat_a = true; - break; - case REL_Y: - rot_raw[1] = (int)rot_input.value; - quat_b = true; - break; - case REL_Z: - rot_raw[2] = (int)rot_input.value; - quat_c = true; - break; - case REL_RX: - rot_raw[3] = (int)rot_input.value; - quat_d = true; - break; - case REL_RY: - rot_raw[4] = (int)rot_input.value; - acc_rot = true; - break; - default: - ERR("rot_input event[type = %d, code = %d] is unknown.", rot_input.type, rot_input.code); - return false; - break; - } - } else if (rot_input.type == EV_SYN) { - syn = true; - fired_time = get_timestamp(&rot_input.time); - } else { - ERR("rot_input event[type = %d, code = %d] is unknown.", rot_input.type, rot_input.code); - return false; - } - } - - AUTOLOCK(m_value_mutex); - - if (quat_a) - m_quat_a = rot_raw[0]; - if (quat_b) - m_quat_b = rot_raw[1]; - if (quat_c) - m_quat_c = rot_raw[2]; - if (quat_d) - m_quat_d = rot_raw[3]; - if (acc_rot) - m_accuracy = rot_raw[4] - 1; /* accuracy bias: -1 */ - - m_fired_time = fired_time; - - DBG("m_quat_a = %d, m_quat_a = %d, m_quat_a = %d, m_quat_d = %d, m_accuracy = %d, time = %lluus", - m_quat_a, m_quat_a, m_quat_a, m_quat_d, m_accuracy, m_fired_time); - - return true; -} - - -bool rv_raw_sensor_hal::is_data_ready(bool wait) -{ - bool ret; - ret = update_value(wait); - return ret; -} - -int rv_raw_sensor_hal::get_sensor_data(sensor_data_t &data) -{ - const float QUAT_SIG_FIGS = 1000000.0f; - - data.accuracy = (m_accuracy == 1) ? 0 : m_accuracy; /* hdst 0 and 1 are needed to calibrate */ - data.timestamp = m_fired_time; - data.value_count = 4; - data.values[0] = (float)m_quat_a / QUAT_SIG_FIGS; - data.values[1] = (float)m_quat_b / QUAT_SIG_FIGS; - data.values[2] = (float)m_quat_c / QUAT_SIG_FIGS; - data.values[3] = (float)m_quat_d / QUAT_SIG_FIGS; - return 0; -} - -bool rv_raw_sensor_hal::get_properties(sensor_properties_t &properties) -{ - properties.name = m_chip_name; - properties.vendor = m_vendor; - properties.min_range = 0; - properties.max_range = 1200; - properties.min_interval = 1; - properties.resolution = 1; - properties.fifo_count = 0; - properties.max_batch_count = 0; - return true; -} - -extern "C" sensor_module* create(void) -{ - rv_raw_sensor_hal *sensor; - - try { - sensor = new(std::nothrow) rv_raw_sensor_hal; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/plugins/rotation_vector/rv_raw/rv_raw_sensor_hal.h b/src/plugins/rotation_vector/rv_raw/rv_raw_sensor_hal.h deleted file mode 100755 index 382f454..0000000 --- a/src/plugins/rotation_vector/rv_raw/rv_raw_sensor_hal.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * rv_raw_sensor_hal - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef _RV_RAW_SENSOR_HAL_H_ -#define _RV_RAW_SENSOR_HAL_H_ - -#include - -class rv_raw_sensor_hal : public sensor_hal -{ -public: - rv_raw_sensor_hal(); - virtual ~rv_raw_sensor_hal(); - std::string get_model_id(void); - sensor_hal_type_t get_type(void); - bool enable(void); - bool disable(void); - bool set_interval(unsigned long val); - bool is_data_ready(bool wait); - virtual int get_sensor_data(sensor_data_t &data); - virtual bool get_properties(sensor_properties_t &properties); -private: - std::string m_model_id; - std::string m_vendor; - std::string m_chip_name; - - unsigned long m_polling_interval; - - int m_quat_a; - int m_quat_b; - int m_quat_c; - int m_quat_d; - int m_accuracy; - - unsigned long long m_fired_time; - int m_node_handle; - - std::string m_enable_node; - std::string m_data_node; - std::string m_interval_node; - - bool m_sensorhub_controlled; - - cmutex m_value_mutex; - - bool update_value(bool wait); -}; -#endif /*_RV_RAW_SENSOR_HAL_H_*/ - diff --git a/src/plugins/temperature/CMakeLists.txt b/src/plugins/temperature/CMakeLists.txt index 87dab53..a2e02a5 100755 --- a/src/plugins/temperature/CMakeLists.txt +++ b/src/plugins/temperature/CMakeLists.txt @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 2.6) project(temperature CXX) SET(SENSOR_NAME temperature_sensor) -SET(SENSOR_HAL_NAME temperature_sensor_hal) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) @@ -22,12 +21,6 @@ add_library(${SENSOR_NAME} SHARED temperature_sensor.cpp ) -add_library(${SENSOR_HAL_NAME} SHARED - temperature_sensor_hal.cpp - ) - target_link_libraries(${SENSOR_NAME} ${temp_pkgs_LDFLAGS} "-lm") -target_link_libraries(${SENSOR_HAL_NAME} ${temp_pkgs_LDFLAGS}) install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) -install(TARGETS ${SENSOR_HAL_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/plugins/temperature/temperature_sensor_hal.cpp b/src/plugins/temperature/temperature_sensor_hal.cpp deleted file mode 100755 index d8952ff..0000000 --- a/src/plugins/temperature/temperature_sensor_hal.cpp +++ /dev/null @@ -1,275 +0,0 @@ -/* - * temperature_sensor_hal - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#include -#include -#include -#include -#include -#include - -using std::string; - -#define SENSOR_TYPE_TEMPERATURE "TEMPERATURE" -#define ELEMENT_NAME "NAME" -#define ELEMENT_VENDOR "VENDOR" -#define ELEMENT_RAW_DATA_UNIT "RAW_DATA_UNIT" - -#define TEMP_INPUT_NAME "temperature_sensor" -#define TEMP_IIO_ENABLE_NODE_NAME "temp_enable" -#define TEMP_SENSORHUB_POLL_NODE_NAME "temp_poll_delay" -#define INITIAL_TIME -1 - -temperature_sensor_hal::temperature_sensor_hal() -: m_temperature(0) -, m_node_handle(-1) -, m_polling_interval(POLL_1HZ_MS) -, m_fired_time(INITIAL_TIME) -{ - const string sensorhub_interval_node_name = TEMP_SENSORHUB_POLL_NODE_NAME; - - node_info_query query; - node_info info; - - if (!find_model_id(SENSOR_TYPE_TEMPERATURE, m_model_id)) { - ERR("Failed to find model id"); - throw ENXIO; - } - - query.sensorhub_controlled = is_sensorhub_controlled(sensorhub_interval_node_name); - query.sensor_type = SENSOR_TYPE_TEMPERATURE; - query.key = TEMP_INPUT_NAME; - query.iio_enable_node_name = TEMP_IIO_ENABLE_NODE_NAME; - query.sensorhub_interval_node_name = sensorhub_interval_node_name; - - if (!get_node_info(query, info)) { - ERR("Failed to get node info"); - throw ENXIO; - } - - show_node_info(info); - - m_data_node = info.data_node_path; - m_enable_node = info.enable_node_path; - m_interval_node = info.interval_node_path; - - csensor_config &config = csensor_config::get_instance(); - - if (!config.get(SENSOR_TYPE_TEMPERATURE, m_model_id, ELEMENT_VENDOR, m_vendor)) { - ERR("[VENDOR] is empty\n"); - throw ENXIO; - } - - if (!config.get(SENSOR_TYPE_TEMPERATURE, m_model_id, ELEMENT_NAME, m_chip_name)) { - ERR("[NAME] is empty\n"); - throw ENXIO; - } - - double raw_data_unit; - - if (!config.get(SENSOR_TYPE_TEMPERATURE, m_model_id, ELEMENT_RAW_DATA_UNIT, raw_data_unit)) { - ERR("[RAW_DATA_UNIT] is empty\n"); - throw ENXIO; - } - - m_raw_data_unit = (float)(raw_data_unit); - - if ((m_node_handle = open(m_data_node.c_str(),O_RDWR)) < 0) { - ERR("Failed to open handle(%d)", m_node_handle); - throw ENXIO; - } - - int clockId = CLOCK_MONOTONIC; - if (ioctl(m_node_handle, EVIOCSCLOCKID, &clockId) != 0) - ERR("Fail to set monotonic timestamp for %s", m_data_node.c_str()); - - INFO("m_vendor = %s", m_vendor.c_str()); - INFO("m_chip_name = %s", m_chip_name.c_str()); - INFO("m_raw_data_unit = %f\n", m_raw_data_unit); - INFO("temperature_sensor_hal is created!\n"); -} - -temperature_sensor_hal::~temperature_sensor_hal() -{ - close(m_node_handle); - m_node_handle = -1; - - INFO("temperature_sensor_hal is destroyed!\n"); -} - -string temperature_sensor_hal::get_model_id(void) -{ - return m_model_id; -} - -sensor_hal_type_t temperature_sensor_hal::get_type(void) -{ - return SENSOR_HAL_TYPE_TEMPERATURE; -} - -bool temperature_sensor_hal::enable(void) -{ - AUTOLOCK(m_mutex); - - set_enable_node(m_enable_node, m_sensorhub_controlled, true, - SENSORHUB_TEMPERATURE_HUMIDITY_ENABLE_BIT); - set_interval(m_polling_interval); - - m_fired_time = 0; - INFO("Temperature sensor real starting"); - return true; -} - -bool temperature_sensor_hal::disable(void) -{ - AUTOLOCK(m_mutex); - - set_enable_node(m_enable_node, m_sensorhub_controlled, false, - SENSORHUB_TEMPERATURE_HUMIDITY_ENABLE_BIT); - - INFO("Temperature sensor real stopping"); - return true; -} - -bool temperature_sensor_hal::set_interval(unsigned long val) -{ - unsigned long long polling_interval_ns; - - AUTOLOCK(m_mutex); - - polling_interval_ns = ((unsigned long long)(val) * 1000llu * 1000llu); - - if (!set_node_value(m_interval_node, polling_interval_ns)) { - ERR("Failed to set polling node: %s\n", m_interval_node.c_str()); - return false; - } - - INFO("Interval is changed from %dms to %dms]", m_polling_interval, val); - m_polling_interval = val; - return true; - -} - -bool temperature_sensor_hal::update_value(bool wait) -{ - int temperature_raw = 0; - bool temperature = false; - int read_input_cnt = 0; - const int INPUT_MAX_BEFORE_SYN = 10; - unsigned long long fired_time = 0; - bool syn = false; - - struct input_event temperature_event; - DBG("temperature event detection!"); - - while ((syn == false) && (read_input_cnt < INPUT_MAX_BEFORE_SYN)) { - int len = read(m_node_handle, &temperature_event, sizeof(temperature_event)); - if (len != sizeof(temperature_event)) { - ERR("temperature_file read fail, read_len = %d\n",len); - return false; - } - - ++read_input_cnt; - - if (temperature_event.type == EV_REL) { - switch (temperature_event.code) { - case REL_HWHEEL: - temperature_raw = (int)temperature_event.value; - temperature = true; - break; - default: - ERR("temperature_event event[type = %d, code = %d] is unknown.", temperature_event.type, temperature_event.code); - return false; - break; - } - } else if (temperature_event.type == EV_SYN) { - syn = true; - fired_time = sensor_hal::get_timestamp(&temperature_event.time); - } else { - ERR("temperature_event event[type = %d, code = %d] is unknown.", temperature_event.type, temperature_event.code); - return false; - } - } - - if (syn == false) { - ERR("EV_SYN didn't come until %d inputs had come", read_input_cnt); - return false; - } - - AUTOLOCK(m_value_mutex); - - if (temperature) - m_temperature = temperature_raw; - - m_fired_time = fired_time; - - DBG("m_temperature = %d, time = %lluus", m_temperature, m_fired_time); - - return true; -} - -bool temperature_sensor_hal::is_data_ready(bool wait) -{ - bool ret; - ret = update_value(wait); - return ret; -} - -int temperature_sensor_hal::get_sensor_data(sensor_data_t &data) -{ - AUTOLOCK(m_value_mutex); - data.accuracy = SENSOR_ACCURACY_GOOD; - data.timestamp = m_fired_time ; - data.value_count = 1; - data.values[0] = (float) m_temperature; - - return 0; -} - - -bool temperature_sensor_hal::get_properties(sensor_properties_s &properties) -{ - properties.name = m_chip_name; - properties.vendor = m_vendor; - properties.min_range = -45; - properties.max_range = 130; - properties.min_interval = 1; - properties.resolution = 1; - properties.fifo_count = 0; - properties.max_batch_count = 0; - - return true; -} - -extern "C" sensor_module* create(void) -{ - temperature_sensor_hal *sensor; - - try { - sensor = new(std::nothrow) temperature_sensor_hal; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/plugins/temperature/temperature_sensor_hal.h b/src/plugins/temperature/temperature_sensor_hal.h deleted file mode 100755 index 1151afc..0000000 --- a/src/plugins/temperature/temperature_sensor_hal.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * temperature_sensor_hal - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef _TEMPERATURE_SENSOR_HAL_H_ -#define _TEMPERATURE_SENSOR_HAL_H_ - -#include - -class temperature_sensor_hal : public sensor_hal -{ -public: - temperature_sensor_hal(); - virtual ~temperature_sensor_hal(); - std::string get_model_id(void); - sensor_hal_type_t get_type(void); - bool enable(void); - bool disable(void); - bool set_interval(unsigned long val); - bool is_data_ready(bool wait); - virtual int get_sensor_data(sensor_data_t &data); - bool get_properties(sensor_properties_s &properties); -private: - float m_temperature; - int m_node_handle; - unsigned long m_polling_interval; - unsigned long long m_fired_time; - - std::string m_model_id; - std::string m_vendor; - std::string m_chip_name; - - float m_raw_data_unit; - - std::string m_data_node; - std::string m_enable_node; - std::string m_interval_node; - - bool m_sensorhub_controlled; - - cmutex m_value_mutex; - - bool update_value(bool wait); -}; -#endif /*_TEMPERATURE_SENSOR_HAL_CLASS_H_*/ diff --git a/src/plugins/ultraviolet/CMakeLists.txt b/src/plugins/ultraviolet/CMakeLists.txt index 218c8dd..609fa5f 100644 --- a/src/plugins/ultraviolet/CMakeLists.txt +++ b/src/plugins/ultraviolet/CMakeLists.txt @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 2.6) project(ultraviolet CXX) SET(SENSOR_NAME ultraviolet_sensor) -SET(SENSOR_HAL_NAME ultraviolet_sensor_hal) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) @@ -19,12 +18,6 @@ add_library(${SENSOR_NAME} SHARED ultraviolet_sensor.cpp ) -add_library(${SENSOR_HAL_NAME} SHARED - ultraviolet_sensor_hal.cpp - ) - target_link_libraries(${SENSOR_NAME} ${uv_pkgs_LDFLAGS} "-lm") -target_link_libraries(${SENSOR_HAL_NAME} ${uv_pkgs_LDFLAGS}) install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) -install(TARGETS ${SENSOR_HAL_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/plugins/ultraviolet/ultraviolet_sensor_hal.cpp b/src/plugins/ultraviolet/ultraviolet_sensor_hal.cpp deleted file mode 100755 index ab6f210..0000000 --- a/src/plugins/ultraviolet/ultraviolet_sensor_hal.cpp +++ /dev/null @@ -1,292 +0,0 @@ -/* - * ultraviolet_sensor_hal - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#include -#include -#include -#include -#include -#include -#include -#include - -using std::ifstream; -using std::string; - -#define SENSOR_TYPE_ULTRAVIOLET "ULTRAVIOLET" -#define ELEMENT_NAME "NAME" -#define ELEMENT_VENDOR "VENDOR" -#define ELEMENT_RAW_DATA_UNIT "RAW_DATA_UNIT" -#define ELEMENT_MIN_RANGE "MIN_RANGE" -#define ELEMENT_MAX_RANGE "MAX_RANGE" -#define ATTR_VALUE "value" - -#define BIAS 1 - -ultraviolet_sensor_hal::ultraviolet_sensor_hal() -: m_polling_interval(POLL_1HZ_MS) -, m_ultraviolet(0) -, m_fired_time(0) -, m_node_handle(-1) -{ - const string sensorhub_interval_node_name = "uv_poll_delay"; - csensor_config &config = csensor_config::get_instance(); - - node_info_query query; - node_info info; - - if (!find_model_id(SENSOR_TYPE_ULTRAVIOLET, m_model_id)) { - ERR("Failed to find model id"); - throw ENXIO; - - } - - query.sensorhub_controlled = m_sensorhub_controlled = is_sensorhub_controlled(sensorhub_interval_node_name); - query.sensor_type = SENSOR_TYPE_ULTRAVIOLET; - query.key = "uv_sensor"; - query.iio_enable_node_name = "uv_enable"; - query.sensorhub_interval_node_name = sensorhub_interval_node_name; - - if (!get_node_info(query, info)) { - ERR("Failed to get node info"); - throw ENXIO; - } - - show_node_info(info); - - m_data_node = info.data_node_path; - m_enable_node = info.enable_node_path; - m_interval_node = info.interval_node_path; - - if (!config.get(SENSOR_TYPE_ULTRAVIOLET, m_model_id, ELEMENT_VENDOR, m_vendor)) { - ERR("[VENDOR] is empty\n"); - throw ENXIO; - } - - INFO("m_vendor = %s", m_vendor.c_str()); - - if (!config.get(SENSOR_TYPE_ULTRAVIOLET, m_model_id, ELEMENT_NAME, m_chip_name)) { - ERR("[NAME] is empty\n"); - throw ENXIO; - } - - INFO("m_chip_name = %s\n",m_chip_name.c_str()); - - double min_range; - - if (!config.get(SENSOR_TYPE_ULTRAVIOLET, m_model_id, ELEMENT_MIN_RANGE, min_range)) { - ERR("[MIN_RANGE] is empty\n"); - throw ENXIO; - } - - m_min_range = (float)min_range; - INFO("m_min_range = %f\n",m_min_range); - - double max_range; - - if (!config.get(SENSOR_TYPE_ULTRAVIOLET, m_model_id, ELEMENT_MAX_RANGE, max_range)) { - ERR("[MAX_RANGE] is empty\n"); - throw ENXIO; - } - - m_max_range = (float)max_range; - INFO("m_max_range = %f\n",m_max_range); - - double raw_data_unit; - - if (!config.get(SENSOR_TYPE_ULTRAVIOLET, m_model_id, ELEMENT_RAW_DATA_UNIT, raw_data_unit)) { - ERR("[RAW_DATA_UNIT] is empty\n"); - throw ENXIO; - } - - m_raw_data_unit = (float)(raw_data_unit); - - if ((m_node_handle = open(m_data_node.c_str(),O_RDWR)) < 0) { - ERR("Failed to open handle(%d)", m_node_handle); - throw ENXIO; - } - - int clockId = CLOCK_MONOTONIC; - if (ioctl(m_node_handle, EVIOCSCLOCKID, &clockId) != 0) - ERR("Fail to set monotonic timestamp for %s", m_data_node.c_str()); - - INFO("m_raw_data_unit = %f\n", m_raw_data_unit); - INFO("ultraviolet_sensor_hal is created!\n"); - -} - -ultraviolet_sensor_hal::~ultraviolet_sensor_hal() -{ - close(m_node_handle); - m_node_handle = -1; - - INFO("ultraviolet_sensor_hal is destroyed!\n"); -} - -string ultraviolet_sensor_hal::get_model_id(void) -{ - return m_model_id; -} - - -sensor_hal_type_t ultraviolet_sensor_hal::get_type(void) -{ - return SENSOR_HAL_TYPE_ULTRAVIOLET; -} - -bool ultraviolet_sensor_hal::enable(void) -{ - AUTOLOCK(m_mutex); - - set_enable_node(m_enable_node, m_sensorhub_controlled, true, SENSORHUB_UV_SENSOR); - set_interval(m_polling_interval); - - m_fired_time = 0; - INFO("ultraviolet sensor real starting"); - return true; -} - -bool ultraviolet_sensor_hal::disable(void) -{ - AUTOLOCK(m_mutex); - - set_enable_node(m_enable_node, m_sensorhub_controlled, false, SENSORHUB_UV_SENSOR); - - INFO("ultraviolet sensor real stopping"); - return true; -} - -bool ultraviolet_sensor_hal::set_interval(unsigned long val) -{ - unsigned long long polling_interval_ns; - - AUTOLOCK(m_mutex); - - polling_interval_ns = ((unsigned long long)(val) * 1000llu * 1000llu); - - if (!set_node_value(m_interval_node, polling_interval_ns)) { - ERR("Failed to set polling resource: %s\n", m_interval_node.c_str()); - return false; - } - - INFO("Interval is changed from %dms to %dms]", m_polling_interval, val); - m_polling_interval = val; - return true; - -} - - -bool ultraviolet_sensor_hal::update_value(bool wait) -{ - int ultraviolet_raw = -1; - bool ultraviolet_sign = false; - bool ultraviolet = false; - int read_input_cnt = 0; - const int INPUT_MAX_BEFORE_SYN = 10; - unsigned long long fired_time = 0; - bool syn = false; - - struct input_event ultraviolet_event; - DBG("ultraviolet event detection!"); - - while ((syn == false) && (read_input_cnt < INPUT_MAX_BEFORE_SYN)) { - int len = read(m_node_handle, &ultraviolet_event, sizeof(ultraviolet_event)); - if (len != sizeof(ultraviolet_event)) { - ERR("ultraviolet file read fail, read_len = %d\n",len); - return false; - } - - ++read_input_cnt; - - if (ultraviolet_event.type == EV_REL && ultraviolet_event.code == REL_X) { - ultraviolet_raw = (int)ultraviolet_event.value; - ultraviolet = true; - } else if (ultraviolet_event.type == EV_REL && ultraviolet_event.code == REL_Y) { - ultraviolet_sign = ((int)ultraviolet_event.value < 0) ? false : true; - } else if (ultraviolet_event.type == EV_SYN) { - syn = true; - fired_time = sensor_hal::get_timestamp(&ultraviolet_event.time); - } else { - ERR("ultraviolet event[type = %d, code = %d] is unknown.", ultraviolet_event.type, ultraviolet_event.code); - return false; - } - } - - AUTOLOCK(m_value_mutex); - - if (ultraviolet && ultraviolet_sign) - m_ultraviolet = ultraviolet_raw - BIAS; - else - return false; - - m_fired_time = fired_time; - - DBG("m_ultraviolet = %d, time = %lluus", m_ultraviolet, m_fired_time); - - return true; -} - -bool ultraviolet_sensor_hal::is_data_ready(bool wait) -{ - bool ret; - ret = update_value(wait); - return ret; -} - -int ultraviolet_sensor_hal::get_sensor_data(sensor_data_t &data) -{ - AUTOLOCK(m_value_mutex); - data.accuracy = SENSOR_ACCURACY_GOOD; - data.timestamp = m_fired_time; - data.value_count = 1; - data.values[0] = (float) m_ultraviolet; - - return 0; -} - -bool ultraviolet_sensor_hal::get_properties(sensor_properties_s &properties) -{ - properties.name = m_chip_name; - properties.vendor = m_vendor; - properties.min_range = m_min_range; - properties.max_range = m_max_range; - properties.min_interval = 1; - properties.resolution = m_raw_data_unit; - properties.fifo_count = 0; - properties.max_batch_count = 0; - - return true; -} - -extern "C" sensor_module* create(void) -{ - ultraviolet_sensor_hal *sensor; - - try { - sensor = new(std::nothrow) ultraviolet_sensor_hal; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/plugins/ultraviolet/ultraviolet_sensor_hal.h b/src/plugins/ultraviolet/ultraviolet_sensor_hal.h deleted file mode 100755 index 5af37ca..0000000 --- a/src/plugins/ultraviolet/ultraviolet_sensor_hal.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * ultraviolet_sensor_hal - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef _ULTRAVIOLET_SENSOR_HAL_H_ -#define _ULTRAVIOLET_SENSOR_HAL_H_ - -#include - -class ultraviolet_sensor_hal : public sensor_hal -{ -public: - ultraviolet_sensor_hal(); - virtual ~ultraviolet_sensor_hal(); - std::string get_model_id(void); - sensor_hal_type_t get_type(void); - bool enable(void); - bool disable(void); - bool set_interval(unsigned long val); - bool is_data_ready(bool wait); - virtual int get_sensor_data(sensor_data_t &data); - bool get_properties(sensor_properties_s &properties); - -private: - std::string m_model_id; - std::string m_vendor; - std::string m_chip_name; - - float m_min_range; - float m_max_range; - float m_raw_data_unit; - - unsigned long m_polling_interval; - - int m_ultraviolet; - - unsigned long long m_fired_time; - int m_node_handle; - - std::string m_enable_node; - std::string m_data_node; - std::string m_interval_node; - - bool m_sensorhub_controlled; - - cmutex m_value_mutex; - - bool update_value(bool wait); -}; -#endif /*_ULTRAVIOLET_SENSOR_HAL_CLASS_H_*/ - diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt index bb7a221..0a55dec 100755 --- a/src/server/CMakeLists.txt +++ b/src/server/CMakeLists.txt @@ -28,6 +28,6 @@ SET(SERVER_SRCS add_executable(${PROJECT_NAME} ${SERVER_SRCS}) -target_link_libraries(${PROJECT_NAME} ${server_pkgs_LDFLAGS} "sensord-server") +target_link_libraries(${PROJECT_NAME} ${server_pkgs_LDFLAGS} "sensord-server" "sensor-hal") install(TARGETS ${PROJECT_NAME} DESTINATION bin) diff --git a/src/shared/CMakeLists.txt b/src/shared/CMakeLists.txt index dc5c9b3..70b421d 100644 --- a/src/shared/CMakeLists.txt +++ b/src/shared/CMakeLists.txt @@ -19,8 +19,6 @@ include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) add_library(sensord-server SHARED worker_thread.cpp - cconfig.cpp - csensor_config.cpp cvirtual_sensor_config.cpp csensor_event_queue.cpp csensor_event_dispatcher.cpp @@ -29,7 +27,6 @@ add_library(sensord-server SHARED cclient_sensor_record.cpp cplugin_info_list.cpp sensor_plugin_loader.cpp - sensor_hal.cpp sensor_base.cpp physical_sensor.cpp virtual_sensor.cpp @@ -39,9 +36,6 @@ add_library(sensord-server SHARED add_library(sensord-share SHARED cpacket.cpp csocket.cpp - cbase_lock.cpp - cmutex.cpp - common.cpp sensor_info.cpp ) @@ -56,31 +50,21 @@ install(FILES sensord-server.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) install(FILES ${PROJECT_NAME}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) install(FILES worker_thread.h - cconfig.h - csensor_config.h cvirtual_sensor_config.h csensor_event_queue.h cplugin_info_list.h sensor_plugin_loader.h - sensor_hal.h sensor_base.h physical_sensor.h virtual_sensor.h - sf_common.h cpacket.h csocket.h cbase_lock.h - cmutex.h - common.h sensor_info.h iio_common.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} ) -install(FILES - sensor_common.h - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor -) install(FILES sensor_accel.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) install(FILES sensor_geomag.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) install(FILES sensor_light.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -- 2.7.4 From 57df674431711e2e719327410f6c1adef300966d Mon Sep 17 00:00:00 2001 From: Ankur Date: Tue, 27 Oct 2015 12:00:45 +0530 Subject: [PATCH 06/16] Renaming libsensord folder to client updated the cmake files etc correspondingly Change-Id: I47e4cc1abbaf8218ac6f4ec299a2b70a00d8ee19 --- src/CMakeLists.txt | 2 +- src/{libsensord => client}/CMakeLists.txt | 0 src/{libsensord => client}/client.cpp | 0 src/{libsensord => client}/client_common.cpp | 0 src/{libsensord => client}/client_common.h | 0 src/{libsensord => client}/command_channel.cpp | 0 src/{libsensord => client}/command_channel.h | 0 src/{libsensord => client}/creg_event_info.h | 0 src/{libsensord => client}/csensor_event_listener.cpp | 0 src/{libsensord => client}/csensor_event_listener.h | 0 src/{libsensord => client}/csensor_handle_info.cpp | 0 src/{libsensord => client}/csensor_handle_info.h | 0 src/{libsensord => client}/poller.cpp | 0 src/{libsensord => client}/poller.h | 0 src/{libsensord => client}/sensor.pc.in | 0 src/{libsensord => client}/sensor_info_manager.cpp | 0 src/{libsensord => client}/sensor_info_manager.h | 0 src/plugins/accel/CMakeLists.txt | 2 +- src/plugins/auto_rotation/CMakeLists.txt | 2 +- src/plugins/bio_led_red/CMakeLists.txt | 2 +- src/plugins/fusion/CMakeLists.txt | 2 +- src/plugins/geo/CMakeLists.txt | 2 +- src/plugins/gravity/CMakeLists.txt | 2 +- src/plugins/gyro/CMakeLists.txt | 2 +- src/plugins/light/CMakeLists.txt | 2 +- src/plugins/linear_accel/CMakeLists.txt | 2 +- src/plugins/orientation/CMakeLists.txt | 2 +- src/plugins/pressure/CMakeLists.txt | 2 +- src/plugins/proxi/CMakeLists.txt | 2 +- src/plugins/rotation_vector/gaming_rv/CMakeLists.txt | 2 +- src/plugins/rotation_vector/geomagnetic_rv/CMakeLists.txt | 2 +- src/plugins/rotation_vector/rv/CMakeLists.txt | 2 +- src/plugins/rotation_vector/rv_raw/CMakeLists.txt | 2 +- src/plugins/sensor_fusion/CMakeLists.txt | 2 +- src/plugins/temperature/CMakeLists.txt | 2 +- src/plugins/tilt/CMakeLists.txt | 2 +- src/plugins/ultraviolet/CMakeLists.txt | 2 +- src/plugins/uncal_gyro/CMakeLists.txt | 2 +- src/server/CMakeLists.txt | 2 +- src/shared/CMakeLists.txt | 2 +- test/CMakeLists.txt | 4 ++-- 41 files changed, 26 insertions(+), 26 deletions(-) rename src/{libsensord => client}/CMakeLists.txt (100%) rename src/{libsensord => client}/client.cpp (100%) rename src/{libsensord => client}/client_common.cpp (100%) rename src/{libsensord => client}/client_common.h (100%) rename src/{libsensord => client}/command_channel.cpp (100%) rename src/{libsensord => client}/command_channel.h (100%) rename src/{libsensord => client}/creg_event_info.h (100%) rename src/{libsensord => client}/csensor_event_listener.cpp (100%) rename src/{libsensord => client}/csensor_event_listener.h (100%) rename src/{libsensord => client}/csensor_handle_info.cpp (100%) rename src/{libsensord => client}/csensor_handle_info.h (100%) rename src/{libsensord => client}/poller.cpp (100%) rename src/{libsensord => client}/poller.h (100%) rename src/{libsensord => client}/sensor.pc.in (100%) rename src/{libsensord => client}/sensor_info_manager.cpp (100%) rename src/{libsensord => client}/sensor_info_manager.h (100%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1087d73..c3b2022 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -88,6 +88,6 @@ ENDIF() add_subdirectory(plugins/rotation_vector) add_subdirectory(server) -add_subdirectory(libsensord) +add_subdirectory(client) add_subdirectory(shared) diff --git a/src/libsensord/CMakeLists.txt b/src/client/CMakeLists.txt similarity index 100% rename from src/libsensord/CMakeLists.txt rename to src/client/CMakeLists.txt diff --git a/src/libsensord/client.cpp b/src/client/client.cpp similarity index 100% rename from src/libsensord/client.cpp rename to src/client/client.cpp diff --git a/src/libsensord/client_common.cpp b/src/client/client_common.cpp similarity index 100% rename from src/libsensord/client_common.cpp rename to src/client/client_common.cpp diff --git a/src/libsensord/client_common.h b/src/client/client_common.h similarity index 100% rename from src/libsensord/client_common.h rename to src/client/client_common.h diff --git a/src/libsensord/command_channel.cpp b/src/client/command_channel.cpp similarity index 100% rename from src/libsensord/command_channel.cpp rename to src/client/command_channel.cpp diff --git a/src/libsensord/command_channel.h b/src/client/command_channel.h similarity index 100% rename from src/libsensord/command_channel.h rename to src/client/command_channel.h diff --git a/src/libsensord/creg_event_info.h b/src/client/creg_event_info.h similarity index 100% rename from src/libsensord/creg_event_info.h rename to src/client/creg_event_info.h diff --git a/src/libsensord/csensor_event_listener.cpp b/src/client/csensor_event_listener.cpp similarity index 100% rename from src/libsensord/csensor_event_listener.cpp rename to src/client/csensor_event_listener.cpp diff --git a/src/libsensord/csensor_event_listener.h b/src/client/csensor_event_listener.h similarity index 100% rename from src/libsensord/csensor_event_listener.h rename to src/client/csensor_event_listener.h diff --git a/src/libsensord/csensor_handle_info.cpp b/src/client/csensor_handle_info.cpp similarity index 100% rename from src/libsensord/csensor_handle_info.cpp rename to src/client/csensor_handle_info.cpp diff --git a/src/libsensord/csensor_handle_info.h b/src/client/csensor_handle_info.h similarity index 100% rename from src/libsensord/csensor_handle_info.h rename to src/client/csensor_handle_info.h diff --git a/src/libsensord/poller.cpp b/src/client/poller.cpp similarity index 100% rename from src/libsensord/poller.cpp rename to src/client/poller.cpp diff --git a/src/libsensord/poller.h b/src/client/poller.h similarity index 100% rename from src/libsensord/poller.h rename to src/client/poller.h diff --git a/src/libsensord/sensor.pc.in b/src/client/sensor.pc.in similarity index 100% rename from src/libsensord/sensor.pc.in rename to src/client/sensor.pc.in diff --git a/src/libsensord/sensor_info_manager.cpp b/src/client/sensor_info_manager.cpp similarity index 100% rename from src/libsensord/sensor_info_manager.cpp rename to src/client/sensor_info_manager.cpp diff --git a/src/libsensord/sensor_info_manager.h b/src/client/sensor_info_manager.h similarity index 100% rename from src/libsensord/sensor_info_manager.h rename to src/client/sensor_info_manager.h diff --git a/src/plugins/accel/CMakeLists.txt b/src/plugins/accel/CMakeLists.txt index 4fcaf97..cab1ebf 100755 --- a/src/plugins/accel/CMakeLists.txt +++ b/src/plugins/accel/CMakeLists.txt @@ -4,7 +4,7 @@ project(accel CXX) SET(SENSOR_NAME accel_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) +include_directories(${CMAKE_SOURCE_DIR}/src/client) FOREACH(flag ${accel_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/plugins/auto_rotation/CMakeLists.txt b/src/plugins/auto_rotation/CMakeLists.txt index 13b56e5..ff0610b 100644 --- a/src/plugins/auto_rotation/CMakeLists.txt +++ b/src/plugins/auto_rotation/CMakeLists.txt @@ -4,7 +4,7 @@ project(auto_rotation CXX) SET(SENSOR_NAME auto_rotation_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) +include_directories(${CMAKE_SOURCE_DIR}/src/client) FOREACH(flag ${auto_rotation_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/plugins/bio_led_red/CMakeLists.txt b/src/plugins/bio_led_red/CMakeLists.txt index 1911384..51b3db8 100644 --- a/src/plugins/bio_led_red/CMakeLists.txt +++ b/src/plugins/bio_led_red/CMakeLists.txt @@ -4,7 +4,7 @@ project(bio_led_red CXX) SET(SENSOR_NAME bio_led_red_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) +include_directories(${CMAKE_SOURCE_DIR}/src/client) FOREACH(flag ${bio_led_red_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/plugins/fusion/CMakeLists.txt b/src/plugins/fusion/CMakeLists.txt index 131a2a8..4554eae 100755 --- a/src/plugins/fusion/CMakeLists.txt +++ b/src/plugins/fusion/CMakeLists.txt @@ -4,7 +4,7 @@ project(fusion CXX) SET(SENSOR_NAME fusion_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) +include_directories(${CMAKE_SOURCE_DIR}/src/client) include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) FOREACH(flag ${fusion_pkgs_LDFLAGS}) diff --git a/src/plugins/geo/CMakeLists.txt b/src/plugins/geo/CMakeLists.txt index ee97dc7..4ecac57 100755 --- a/src/plugins/geo/CMakeLists.txt +++ b/src/plugins/geo/CMakeLists.txt @@ -4,7 +4,7 @@ project(geo CXX) SET(SENSOR_NAME geo_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) +include_directories(${CMAKE_SOURCE_DIR}/src/client) FOREACH(flag ${geo_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/plugins/gravity/CMakeLists.txt b/src/plugins/gravity/CMakeLists.txt index 5491c47..66bf3fa 100755 --- a/src/plugins/gravity/CMakeLists.txt +++ b/src/plugins/gravity/CMakeLists.txt @@ -4,7 +4,7 @@ project(gravity CXX) SET(SENSOR_NAME gravity_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) +include_directories(${CMAKE_SOURCE_DIR}/src/client) include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) FOREACH(flag ${gravity_pkgs_LDFLAGS}) diff --git a/src/plugins/gyro/CMakeLists.txt b/src/plugins/gyro/CMakeLists.txt index c8e6d38..6f7edd6 100755 --- a/src/plugins/gyro/CMakeLists.txt +++ b/src/plugins/gyro/CMakeLists.txt @@ -4,7 +4,7 @@ project(gyro CXX) SET(SENSOR_NAME gyro_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) +include_directories(${CMAKE_SOURCE_DIR}/src/client) FOREACH(flag ${gyro_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/plugins/light/CMakeLists.txt b/src/plugins/light/CMakeLists.txt index 71ffd6a..44dc3bb 100755 --- a/src/plugins/light/CMakeLists.txt +++ b/src/plugins/light/CMakeLists.txt @@ -4,7 +4,7 @@ project(light CXX) SET(SENSOR_NAME light_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) +include_directories(${CMAKE_SOURCE_DIR}/src/client) FOREACH(flag ${light_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/plugins/linear_accel/CMakeLists.txt b/src/plugins/linear_accel/CMakeLists.txt index c819bf7..586dad0 100755 --- a/src/plugins/linear_accel/CMakeLists.txt +++ b/src/plugins/linear_accel/CMakeLists.txt @@ -4,7 +4,7 @@ project(linear_accel CXX) SET(SENSOR_NAME linear_accel_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) +include_directories(${CMAKE_SOURCE_DIR}/src/client) include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) FOREACH(flag ${linear_accel_pkgs_LDFLAGS}) diff --git a/src/plugins/orientation/CMakeLists.txt b/src/plugins/orientation/CMakeLists.txt index 455f0f4..15a5054 100755 --- a/src/plugins/orientation/CMakeLists.txt +++ b/src/plugins/orientation/CMakeLists.txt @@ -4,7 +4,7 @@ project(orientation CXX) SET(SENSOR_NAME orientation_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) +include_directories(${CMAKE_SOURCE_DIR}/src/client) include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) FOREACH(flag ${orientation_pkgs_LDFLAGS}) diff --git a/src/plugins/pressure/CMakeLists.txt b/src/plugins/pressure/CMakeLists.txt index db0c209..955f393 100755 --- a/src/plugins/pressure/CMakeLists.txt +++ b/src/plugins/pressure/CMakeLists.txt @@ -4,7 +4,7 @@ project(pressure CXX) SET(SENSOR_NAME pressure_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) +include_directories(${CMAKE_SOURCE_DIR}/src/client) FOREACH(flag ${pressure_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/plugins/proxi/CMakeLists.txt b/src/plugins/proxi/CMakeLists.txt index 7cd377e..1b9d4e3 100755 --- a/src/plugins/proxi/CMakeLists.txt +++ b/src/plugins/proxi/CMakeLists.txt @@ -4,7 +4,7 @@ project(proxi CXX) SET(SENSOR_NAME proxi_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) +include_directories(${CMAKE_SOURCE_DIR}/src/client) FOREACH(flag ${proxi_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/plugins/rotation_vector/gaming_rv/CMakeLists.txt b/src/plugins/rotation_vector/gaming_rv/CMakeLists.txt index 2d13a9f..da5bc7b 100755 --- a/src/plugins/rotation_vector/gaming_rv/CMakeLists.txt +++ b/src/plugins/rotation_vector/gaming_rv/CMakeLists.txt @@ -4,7 +4,7 @@ project(gaming_rv CXX) SET(SENSOR_NAME gaming_rv_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) +include_directories(${CMAKE_SOURCE_DIR}/src/client) include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) FOREACH(flag ${gaming_rv_pkgs_LDFLAGS}) diff --git a/src/plugins/rotation_vector/geomagnetic_rv/CMakeLists.txt b/src/plugins/rotation_vector/geomagnetic_rv/CMakeLists.txt index 56bd3c1..7055dc7 100755 --- a/src/plugins/rotation_vector/geomagnetic_rv/CMakeLists.txt +++ b/src/plugins/rotation_vector/geomagnetic_rv/CMakeLists.txt @@ -4,7 +4,7 @@ project(geomagnetic_rv CXX) SET(SENSOR_NAME geomagnetic_rv_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) +include_directories(${CMAKE_SOURCE_DIR}/src/client) include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) FOREACH(flag ${geomagnetic_rv_pkgs_LDFLAGS}) diff --git a/src/plugins/rotation_vector/rv/CMakeLists.txt b/src/plugins/rotation_vector/rv/CMakeLists.txt index 4cbb90f..dd785ff 100755 --- a/src/plugins/rotation_vector/rv/CMakeLists.txt +++ b/src/plugins/rotation_vector/rv/CMakeLists.txt @@ -4,7 +4,7 @@ project(rv CXX) SET(SENSOR_NAME rv_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) +include_directories(${CMAKE_SOURCE_DIR}/src/client) include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) FOREACH(flag ${rv_pkgs_LDFLAGS}) diff --git a/src/plugins/rotation_vector/rv_raw/CMakeLists.txt b/src/plugins/rotation_vector/rv_raw/CMakeLists.txt index 99c993f..d4cdfa1 100755 --- a/src/plugins/rotation_vector/rv_raw/CMakeLists.txt +++ b/src/plugins/rotation_vector/rv_raw/CMakeLists.txt @@ -4,7 +4,7 @@ project(rv_raw CXX) SET(SENSOR_NAME rv_raw_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) +include_directories(${CMAKE_SOURCE_DIR}/src/client) INCLUDE(FindPkgConfig) PKG_CHECK_MODULES(rv_raw_pkgs REQUIRED vconf) diff --git a/src/plugins/sensor_fusion/CMakeLists.txt b/src/plugins/sensor_fusion/CMakeLists.txt index 627d6ec..5779576 100755 --- a/src/plugins/sensor_fusion/CMakeLists.txt +++ b/src/plugins/sensor_fusion/CMakeLists.txt @@ -6,7 +6,7 @@ SET(EXEC_PREFIX "\${prefix}") SET(VERSION 1.0) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) +include_directories(${CMAKE_SOURCE_DIR}/src/client) set(PROJECT_MAJOR_VERSION "0") set(PROJECT_MINOR_VERSION "0") diff --git a/src/plugins/temperature/CMakeLists.txt b/src/plugins/temperature/CMakeLists.txt index a2e02a5..e230207 100755 --- a/src/plugins/temperature/CMakeLists.txt +++ b/src/plugins/temperature/CMakeLists.txt @@ -4,7 +4,7 @@ project(temperature CXX) SET(SENSOR_NAME temperature_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) +include_directories(${CMAKE_SOURCE_DIR}/src/client) INCLUDE(FindPkgConfig) PKG_CHECK_MODULES(temp_pkgs REQUIRED vconf) diff --git a/src/plugins/tilt/CMakeLists.txt b/src/plugins/tilt/CMakeLists.txt index 6bd9b97..727727c 100755 --- a/src/plugins/tilt/CMakeLists.txt +++ b/src/plugins/tilt/CMakeLists.txt @@ -4,7 +4,7 @@ project(tilt CXX) SET(SENSOR_NAME tilt_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) +include_directories(${CMAKE_SOURCE_DIR}/src/client) include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) FOREACH(flag ${tilt_pkgs_LDFLAGS}) diff --git a/src/plugins/ultraviolet/CMakeLists.txt b/src/plugins/ultraviolet/CMakeLists.txt index 609fa5f..b711897 100644 --- a/src/plugins/ultraviolet/CMakeLists.txt +++ b/src/plugins/ultraviolet/CMakeLists.txt @@ -4,7 +4,7 @@ project(ultraviolet CXX) SET(SENSOR_NAME ultraviolet_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) +include_directories(${CMAKE_SOURCE_DIR}/src/client) FOREACH(flag ${uv_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/plugins/uncal_gyro/CMakeLists.txt b/src/plugins/uncal_gyro/CMakeLists.txt index 056962a..d983a91 100644 --- a/src/plugins/uncal_gyro/CMakeLists.txt +++ b/src/plugins/uncal_gyro/CMakeLists.txt @@ -4,7 +4,7 @@ project(uncal_gyro CXX) SET(SENSOR_NAME uncal_gyro_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) +include_directories(${CMAKE_SOURCE_DIR}/src/client) include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) FOREACH(flag ${gravity_pkgs_LDFLAGS}) diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt index 0a55dec..4d4ebfb 100755 --- a/src/server/CMakeLists.txt +++ b/src/server/CMakeLists.txt @@ -13,7 +13,7 @@ FOREACH(flag ${server_pkgs_CFLAGS}) ENDFOREACH(flag) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) +include_directories(${CMAKE_SOURCE_DIR}/src/client) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lrt -ldl -pthread -fPIE") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie") diff --git a/src/shared/CMakeLists.txt b/src/shared/CMakeLists.txt index 70b421d..b11b4b1 100644 --- a/src/shared/CMakeLists.txt +++ b/src/shared/CMakeLists.txt @@ -15,7 +15,7 @@ ENDFOREACH(flag) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) +include_directories(${CMAKE_SOURCE_DIR}/src/client) add_library(sensord-server SHARED worker_thread.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a59c341..66d24d9 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -14,7 +14,7 @@ add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}") configure_file(${PROJECT_NAME}.pc.in ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc @ONLY) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/libsensord) +include_directories(${CMAKE_SOURCE_DIR}/src/client) include_directories(${CMAKE_SOURCE_DIR}/src/shared) FOREACH(flag ${pkgs_CFLAGS}) @@ -23,7 +23,7 @@ ENDFOREACH(flag) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") -link_directories(../src/libsensord/) +link_directories(../src/client/) add_executable(api-test src/api-test.c) add_executable(sensor-test src/sensor-test.c src/check-sensor.c) -- 2.7.4 From 5cb9b01b7ae6c559300f7dc5f1666bba9b791848 Mon Sep 17 00:00:00 2001 From: Ankur Date: Wed, 28 Oct 2015 13:01:58 +0530 Subject: [PATCH 07/16] Adding interface file and updating the corresponding files Change-Id: I8f91282995b2ff49195ae9b2c15b740df6635a42 --- src/plugins/accel/accel_sensor.cpp | 2 +- src/plugins/bio_led_red/bio_led_red_sensor.cpp | 2 +- src/plugins/geo/geo_sensor.cpp | 2 +- src/plugins/gyro/gyro_sensor.cpp | 2 +- src/plugins/light/light_sensor.cpp | 2 +- src/plugins/pressure/pressure_sensor.cpp | 2 +- src/plugins/proxi/proxi_sensor.cpp | 2 +- .../rotation_vector/rv_raw/rv_raw_sensor.cpp | 2 +- src/plugins/temperature/temperature_sensor.cpp | 2 +- src/plugins/ultraviolet/ultraviolet_sensor.cpp | 2 +- src/shared/sensor_hal.cpp | 404 --------------------- src/shared/sensor_hal.h | 86 +---- 12 files changed, 17 insertions(+), 493 deletions(-) delete mode 100644 src/shared/sensor_hal.cpp diff --git a/src/plugins/accel/accel_sensor.cpp b/src/plugins/accel/accel_sensor.cpp index 0db4c12..8bd5451 100755 --- a/src/plugins/accel/accel_sensor.cpp +++ b/src/plugins/accel/accel_sensor.cpp @@ -98,7 +98,7 @@ bool accel_sensor::process_event(void) { sensor_event_t base_event; - if (!m_sensor_hal->is_data_ready(true)) + if (!m_sensor_hal->is_data_ready()) return true; m_sensor_hal->get_sensor_data(base_event.data); diff --git a/src/plugins/bio_led_red/bio_led_red_sensor.cpp b/src/plugins/bio_led_red/bio_led_red_sensor.cpp index 07006c7..42405b8 100755 --- a/src/plugins/bio_led_red/bio_led_red_sensor.cpp +++ b/src/plugins/bio_led_red/bio_led_red_sensor.cpp @@ -75,7 +75,7 @@ bool bio_led_red_sensor::process_event(void) { sensor_event_t event; - if (!m_sensor_hal->is_data_ready(true)) + if (!m_sensor_hal->is_data_ready()) return true; m_sensor_hal->get_sensor_data(event.data); diff --git a/src/plugins/geo/geo_sensor.cpp b/src/plugins/geo/geo_sensor.cpp index 6d9c170..7c9f670 100755 --- a/src/plugins/geo/geo_sensor.cpp +++ b/src/plugins/geo/geo_sensor.cpp @@ -84,7 +84,7 @@ bool geo_sensor::process_event(void) { sensor_event_t event; - if (!m_sensor_hal->is_data_ready(true)) + if (!m_sensor_hal->is_data_ready()) return true; m_sensor_hal->get_sensor_data(event.data); diff --git a/src/plugins/gyro/gyro_sensor.cpp b/src/plugins/gyro/gyro_sensor.cpp index 2cb2859..aeab006 100755 --- a/src/plugins/gyro/gyro_sensor.cpp +++ b/src/plugins/gyro/gyro_sensor.cpp @@ -87,7 +87,7 @@ bool gyro_sensor::process_event(void) { sensor_event_t event; - if (m_sensor_hal->is_data_ready(true) == false) + if (m_sensor_hal->is_data_ready() == false) return true; m_sensor_hal->get_sensor_data(event.data); diff --git a/src/plugins/light/light_sensor.cpp b/src/plugins/light/light_sensor.cpp index e0a61f1..0b9062e 100755 --- a/src/plugins/light/light_sensor.cpp +++ b/src/plugins/light/light_sensor.cpp @@ -87,7 +87,7 @@ bool light_sensor::process_event(void) sensor_event_t event; int level; - if (!m_sensor_hal->is_data_ready(true)) + if (!m_sensor_hal->is_data_ready()) return true; m_sensor_hal->get_sensor_data(event.data); diff --git a/src/plugins/pressure/pressure_sensor.cpp b/src/plugins/pressure/pressure_sensor.cpp index 0559021..33f3b76 100755 --- a/src/plugins/pressure/pressure_sensor.cpp +++ b/src/plugins/pressure/pressure_sensor.cpp @@ -117,7 +117,7 @@ bool pressure_sensor::process_event(void) { sensor_event_t event; - if (!m_sensor_hal->is_data_ready(true)) + if (!m_sensor_hal->is_data_ready()) return true; m_sensor_hal->get_sensor_data(event.data); diff --git a/src/plugins/proxi/proxi_sensor.cpp b/src/plugins/proxi/proxi_sensor.cpp index 9486de7..ab11ee3 100755 --- a/src/plugins/proxi/proxi_sensor.cpp +++ b/src/plugins/proxi/proxi_sensor.cpp @@ -74,7 +74,7 @@ bool proxi_sensor::process_event(void) sensor_event_t event; int state; - if (!m_sensor_hal->is_data_ready(true)) + if (!m_sensor_hal->is_data_ready()) return true; m_sensor_hal->get_sensor_data(event.data); diff --git a/src/plugins/rotation_vector/rv_raw/rv_raw_sensor.cpp b/src/plugins/rotation_vector/rv_raw/rv_raw_sensor.cpp index f1b3a2b..3b9b09e 100755 --- a/src/plugins/rotation_vector/rv_raw/rv_raw_sensor.cpp +++ b/src/plugins/rotation_vector/rv_raw/rv_raw_sensor.cpp @@ -82,7 +82,7 @@ bool rv_raw_sensor::process_event(void) { sensor_event_t event; - if (!m_sensor_hal->is_data_ready(true)) + if (!m_sensor_hal->is_data_ready()) return true; m_sensor_hal->get_sensor_data(event.data); diff --git a/src/plugins/temperature/temperature_sensor.cpp b/src/plugins/temperature/temperature_sensor.cpp index 5b09eb1..679be58 100755 --- a/src/plugins/temperature/temperature_sensor.cpp +++ b/src/plugins/temperature/temperature_sensor.cpp @@ -81,7 +81,7 @@ bool temperature_sensor::process_event(void) { sensor_event_t event; - if (!m_sensor_hal->is_data_ready(true)) + if (!m_sensor_hal->is_data_ready()) return true; m_sensor_hal->get_sensor_data(event.data); diff --git a/src/plugins/ultraviolet/ultraviolet_sensor.cpp b/src/plugins/ultraviolet/ultraviolet_sensor.cpp index e47dc9d..0b0cd43 100755 --- a/src/plugins/ultraviolet/ultraviolet_sensor.cpp +++ b/src/plugins/ultraviolet/ultraviolet_sensor.cpp @@ -82,7 +82,7 @@ bool ultraviolet_sensor::process_event(void) { sensor_event_t event; - if (!m_sensor_hal->is_data_ready(true)) + if (!m_sensor_hal->is_data_ready()) return true; m_sensor_hal->get_sensor_data(event.data); diff --git a/src/shared/sensor_hal.cpp b/src/shared/sensor_hal.cpp deleted file mode 100644 index dc4fcfb..0000000 --- a/src/shared/sensor_hal.cpp +++ /dev/null @@ -1,404 +0,0 @@ -/* - * libsensord-share - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include -#include -#include -#include -#include - -using std::ifstream; -using std::ofstream; -using std::fstream; -using std::string; - -cmutex sensor_hal::m_shared_mutex; - -sensor_hal::sensor_hal() -{ -} - -sensor_hal::~sensor_hal() -{ -} - -bool sensor_hal::init(void *data) -{ - return true; -} - -bool sensor_hal::is_wakeup_supported(void) -{ - return false; -} - -bool sensor_hal::set_interval(unsigned long val) -{ - return true; -} - -long sensor_hal::set_command(unsigned int cmd, long val) -{ - return -1; -} - -bool sensor_hal::set_wakeup(int wakeup) -{ - return false; -} - -int sensor_hal::send_sensorhub_data(const char* data, int data_len) -{ - return -1; -} - -int sensor_hal::get_sensor_data(sensor_data_t &data) -{ - return -1; -} - -int sensor_hal::get_sensor_data(sensorhub_data_t &data) -{ - return -1; -} - -unsigned long long sensor_hal::get_timestamp(void) -{ - struct timespec t; - clock_gettime(CLOCK_MONOTONIC, &t); - return ((unsigned long long)(t.tv_sec)*1000000000LL + t.tv_nsec) / 1000; -} - -unsigned long long sensor_hal::get_timestamp(timeval *t) -{ - if (!t) { - ERR("t is NULL"); - return 0; - } - - return ((unsigned long long)(t->tv_sec)*1000000LL +t->tv_usec); -} - -bool sensor_hal::is_sensorhub_controlled(const string &key) -{ - string key_node = string("/sys/class/sensors/ssp_sensor/") + key; - - if (access(key_node.c_str(), F_OK) == 0) - return true; - - return false; -} - -bool sensor_hal::get_node_info(const node_info_query &query, node_info &info) -{ - bool ret = false; - int method; - string device_num; - - if (!get_input_method(query.key, method, device_num)) { - ERR("Failed to get input method for %s", query.key.c_str()); - return false; - } - - info.method = method; - - if (method == IIO_METHOD) { - if (query.sensorhub_controlled) - ret = get_sensorhub_iio_node_info(query.sensorhub_interval_node_name, device_num, info); - else - ret = get_iio_node_info(query.iio_enable_node_name, device_num, info); - } else { - if (query.sensorhub_controlled) - ret = get_sensorhub_input_event_node_info(query.sensorhub_interval_node_name, device_num, info); - else - ret = get_input_event_node_info(device_num, info); - } - - return ret; -} - - -void sensor_hal::show_node_info(node_info &info) -{ - if (info.data_node_path.size()) - INFO("Data node: %s", info.data_node_path.c_str()); - if (info.enable_node_path.size()) - INFO("Enable node: %s", info.enable_node_path.c_str()); - if (info.interval_node_path.size()) - INFO("Interval node: %s", info.interval_node_path.c_str()); - if (info.buffer_enable_node_path.size()) - INFO("Buffer enable node: %s", info.buffer_enable_node_path.c_str()); - if (info.buffer_length_node_path.size()) - INFO("Buffer length node: %s", info.buffer_length_node_path.c_str()); - if (info.trigger_node_path.size()) - INFO("Trigger node: %s", info.trigger_node_path.c_str()); -} - -bool sensor_hal::get_iio_node_info(const string& enable_node_name, const string& device_num, node_info &info) -{ - const string base_dir = string("/sys/bus/iio/devices/iio:device") + device_num + string("/"); - - info.data_node_path = string("/dev/iio:device") + device_num; - info.enable_node_path = base_dir + enable_node_name; - info.interval_node_path = base_dir + string("sampling_frequency"); - info.buffer_enable_node_path = base_dir + string("buffer/enable"); - info.buffer_length_node_path = base_dir + string("buffer/length"); - info.trigger_node_path = base_dir + string("trigger/current_trigger"); - - return true; -} - -bool sensor_hal::get_sensorhub_iio_node_info(const string &interval_node_name, const string& device_num, node_info &info) -{ - const string base_dir = string("/sys/bus/iio/devices/iio:device") + device_num + string("/"); - const string hub_dir = "/sys/class/sensors/ssp_sensor/"; - - info.data_node_path = string("/dev/iio:device") + device_num; - info.enable_node_path = hub_dir + string("enable"); - info.interval_node_path = hub_dir + interval_node_name; - info.buffer_enable_node_path = base_dir + string("buffer/enable"); - info.buffer_length_node_path = base_dir + string("buffer/length"); - return true; -} - -bool sensor_hal::get_input_event_node_info(const string& device_num, node_info &info) -{ - string base_dir; - string event_num; - - base_dir = string("/sys/class/input/input") + device_num + string("/"); - - if (!get_event_num(base_dir, event_num)) - return false; - - info.data_node_path = string("/dev/input/event") + event_num; - - info.enable_node_path = base_dir + string("enable"); - info.interval_node_path = base_dir + string("poll_delay"); - return true; -} - -bool sensor_hal::get_sensorhub_input_event_node_info(const string &interval_node_name, const string& device_num, node_info &info) -{ - const string base_dir = "/sys/class/sensors/ssp_sensor/"; - string event_num; - - string input_dir = string("/sys/class/input/input") + device_num + string("/"); - - if (!get_event_num(input_dir, event_num)) - return false; - - info.data_node_path = string("/dev/input/event") + event_num; - info.enable_node_path = base_dir + string("enable"); - info.interval_node_path = base_dir + interval_node_name; - return true; -} - -bool sensor_hal::set_node_value(const string &node_path, int value) -{ - ofstream node(node_path, ofstream::binary); - - if (!node) - return false; - - node << value; - - return true; -} - -bool sensor_hal::set_node_value(const string &node_path, unsigned long long value) -{ - ofstream node(node_path, ofstream::binary); - - if (!node) - return false; - - node << value; - - return true; -} - - -bool sensor_hal::get_node_value(const string &node_path, int &value) -{ - ifstream node(node_path, ifstream::binary); - - if (!node) - return false; - - node >> value; - - return true; -} - -bool sensor_hal::set_enable_node(const string &node_path, bool sensorhub_controlled, bool enable, int enable_bit) -{ - int prev_status, status; - - AUTOLOCK(m_shared_mutex); - - if (!get_node_value(node_path, prev_status)) { - ERR("Failed to get node: %s", node_path.c_str()); - return false; - } - - int _enable_bit = sensorhub_controlled ? enable_bit : 0; - - if (enable) - status = prev_status | (1 << _enable_bit); - else - status = prev_status & (~(1 << _enable_bit)); - - if (!set_node_value(node_path, status)) { - ERR("Failed to set node: %s", node_path.c_str()); - return false; - } - - return true; -} - - -bool sensor_hal::find_model_id(const string &sensor_type, string &model_id) -{ - string dir_path = "/sys/class/sensors/"; - string name_node, name; - string d_name; - DIR *dir = NULL; - struct dirent *dir_entry = NULL; - bool find = false; - - dir = opendir(dir_path.c_str()); - if (!dir) { - DBG("Failed to open dir: %s", dir_path.c_str()); - return false; - } - - while (!find && (dir_entry = readdir(dir))) { - d_name = string(dir_entry->d_name); - - if ((d_name != ".") && (d_name != "..") && (dir_entry->d_ino != 0)) { - name_node = dir_path + d_name + string("/name"); - - ifstream infile(name_node.c_str()); - - if (!infile) - continue; - - infile >> name; - - if (csensor_config::get_instance().is_supported(sensor_type, name)) { - model_id = name; - find = true; - break; - } - } - } - - closedir(dir); - - return find; -} - -bool sensor_hal::get_event_num(const string &input_path, string &event_num) -{ - const string event_prefix = "event"; - DIR *dir = NULL; - struct dirent *dir_entry = NULL; - string node_name; - bool find = false; - - dir = opendir(input_path.c_str()); - if (!dir) { - ERR("Failed to open dir: %s", input_path.c_str()); - return false; - } - - int prefix_size = event_prefix.size(); - - while (!find && (dir_entry = readdir(dir))) { - node_name = dir_entry->d_name; - - if (node_name.compare(0, prefix_size, event_prefix) == 0) { - event_num = node_name.substr(prefix_size, node_name.size() - prefix_size); - find = true; - break; - } - } - - closedir(dir); - - return find; -} - -bool sensor_hal::get_input_method(const string &key, int &method, string &device_num) -{ - input_method_info input_info[2] = { - {INPUT_EVENT_METHOD, "/sys/class/input/", "input"}, - {IIO_METHOD, "/sys/bus/iio/devices/", "iio:device"} - }; - - const int input_info_len = sizeof(input_info)/sizeof(input_info[0]); - size_t prefix_size; - string name_node, name; - string d_name; - DIR *dir = NULL; - struct dirent *dir_entry = NULL; - bool find = false; - - for (int i = 0; i < input_info_len; ++i) { - - prefix_size = input_info[i].prefix.size(); - - dir = opendir(input_info[i].dir_path.c_str()); - if (!dir) { - ERR("Failed to open dir: %s", input_info[i].dir_path.c_str()); - return false; - } - - find = false; - - while (!find && (dir_entry = readdir(dir))) { - d_name = string(dir_entry->d_name); - - if (d_name.compare(0, prefix_size, input_info[i].prefix) == 0) { - name_node = input_info[i].dir_path + d_name + string("/name"); - - ifstream infile(name_node.c_str()); - if (!infile) - continue; - - infile >> name; - - if (name == key) { - device_num = d_name.substr(prefix_size, d_name.size() - prefix_size); - find = true; - method = input_info[i].method; - break; - } - } - } - - closedir(dir); - - if (find) - break; - } - - return find; -} diff --git a/src/shared/sensor_hal.h b/src/shared/sensor_hal.h index 7111276..8e14b22 100644 --- a/src/shared/sensor_hal.h +++ b/src/shared/sensor_hal.h @@ -1,7 +1,7 @@ /* * libsensord-share * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,20 +19,8 @@ #ifndef _SENSOR_HAL_H_ #define _SENSOR_HAL_H_ -#include -#include -#include -#include #include - -/* -* As of Linux 3.4, there is a new EVIOCSCLOCKID ioctl to set the desired clock -* Current kernel-headers package doesn't have it so we should define it here. -*/ - -#ifndef EVIOCSCLOCKID -#define EVIOCSCLOCKID _IOW('E', 0xa0, int) /* Set clockid to be used for timestamps */ -#endif +#include typedef enum { SENSOR_HAL_TYPE_ACCELEROMETER, @@ -59,36 +47,7 @@ typedef enum { SENSOR_HAL_TYPE_FUSION, } sensor_hal_type_t; -typedef struct { - int method; - std::string data_node_path; - std::string enable_node_path; - std::string interval_node_path; - std::string buffer_enable_node_path; - std::string buffer_length_node_path; - std::string trigger_node_path; -} node_info; - -typedef struct { - bool sensorhub_controlled; - std::string sensor_type; - std::string key; - std::string iio_enable_node_name; - std::string sensorhub_interval_node_name; -} node_info_query; -enum input_method { - IIO_METHOD = 0, - INPUT_EVENT_METHOD = 1, -}; - -typedef struct { - int method; - std::string dir_path; - std::string prefix; -} input_method_info; - -#define DEFAULT_WAIT_TIME 0 class sensor_hal { @@ -96,44 +55,13 @@ public: sensor_hal(); virtual ~sensor_hal(); - virtual bool init(void *data = NULL); virtual std::string get_model_id(void) = 0; virtual sensor_hal_type_t get_type(void) = 0; virtual bool enable(void) = 0; virtual bool disable(void) = 0; - virtual bool set_interval(unsigned long val); - virtual bool is_data_ready(bool wait) = 0; - virtual bool is_wakeup_supported(void); - virtual bool get_properties(sensor_properties_s &properties) {return false;}; - virtual bool get_properties(sensor_type_t sensor_type, sensor_properties_s &properties) {return false;}; - virtual int get_sensor_data(sensor_data_t &data); - virtual int get_sensor_data(sensorhub_data_t &data); - virtual long set_command(unsigned int cmd, long val); - virtual bool set_wakeup(int wakeup); - virtual int send_sensorhub_data(const char *data, int data_len); - -protected: - cmutex m_mutex; - static cmutex m_shared_mutex; - - virtual bool set_enable_node(const std::string &node_path, bool sensorhub_controlled, bool enable, int enable_bit = 0); - - static unsigned long long get_timestamp(void); - static unsigned long long get_timestamp(timeval *t); - static bool find_model_id(const std::string &sensor_type, std::string &model_id); - static bool is_sensorhub_controlled(const std::string &key); - static bool get_node_info(const node_info_query &query, node_info &info); - static void show_node_info(node_info &info); - static bool set_node_value(const std::string &node_path, int value); - static bool set_node_value(const std::string &node_path, unsigned long long value); - static bool get_node_value(const std::string &node_path, int &value); -private: - static bool get_event_num(const std::string &node_path, std::string &event_num); - static bool get_input_method(const std::string &key, int &method, std::string &device_num); - - static bool get_iio_node_info(const std::string& enable_node_name, const std::string& device_num, node_info &info); - static bool get_sensorhub_iio_node_info(const std::string &interval_node_name, const std::string& device_num, node_info &info); - static bool get_input_event_node_info(const std::string& device_num, node_info &info); - static bool get_sensorhub_input_event_node_info(const std::string &interval_node_name, const std::string& device_num, node_info &info); + virtual bool is_data_ready(void) = 0; + virtual bool set_interval(unsigned long val) = 0; + virtual int get_sensor_data(sensor_data_t &data) = 0; + virtual bool get_properties(sensor_properties_s &properties) = 0; }; -#endif /*_SENSOR_HAL_CLASS_H_*/ +#endif /*_SENSOR_HAL_H_*/ -- 2.7.4 From eaffbfcfc43378a696f90d5d163bbd0decf7facd Mon Sep 17 00:00:00 2001 From: Ramasamy Date: Wed, 28 Oct 2015 20:07:49 +0900 Subject: [PATCH 08/16] Restructuring sensord package - Renaming, moving and restructuring files logically Change-Id: Ifec6471c36be4669dbd90c1f1c0fe714a6267f5b --- src/{shared => server}/cclient_info_manager.cpp | 0 src/{shared => server}/cclient_info_manager.h | 0 src/{shared => server}/cclient_sensor_record.cpp | 0 src/{shared => server}/cclient_sensor_record.h | 0 src/{shared => server}/cconfig.cpp | 0 src/{shared => server}/cconfig.h | 0 src/{shared => server}/cplugin_info_list.cpp | 0 src/{shared => server}/cplugin_info_list.h | 0 .../csensor_event_dispatcher.cpp | 0 src/{shared => server}/csensor_event_dispatcher.h | 0 src/{shared => server}/csensor_event_queue.cpp | 0 src/{shared => server}/csensor_event_queue.h | 0 src/{shared => server}/csensor_usage.cpp | 0 src/{shared => server}/csensor_usage.h | 0 src/{shared => server}/cvirtual_sensor_config.cpp | 0 src/{shared => server}/cvirtual_sensor_config.h | 0 src/{shared => server}/physical_sensor.cpp | 0 src/{shared => server}/physical_sensor.h | 0 src/{ => server}/plugins/accel/CMakeLists.txt | 0 src/{ => server}/plugins/accel/accel_sensor.cpp | 0 src/{ => server}/plugins/accel/accel_sensor.h | 0 .../plugins/auto_rotation/CMakeLists.txt | 0 .../plugins/auto_rotation/auto_rotation_alg.cpp | 0 .../plugins/auto_rotation/auto_rotation_alg.h | 0 .../auto_rotation/auto_rotation_alg_emul.cpp | 0 .../plugins/auto_rotation/auto_rotation_alg_emul.h | 0 .../plugins/auto_rotation/auto_rotation_sensor.cpp | 0 .../plugins/auto_rotation/auto_rotation_sensor.h | 0 .../plugins/bio_led_red/CMakeLists.txt | 0 .../plugins/bio_led_red/bio_led_red_sensor.cpp | 0 .../plugins/bio_led_red/bio_led_red_sensor.h | 0 src/{ => server}/plugins/fusion/CMakeLists.txt | 0 src/{ => server}/plugins/fusion/fusion_sensor.cpp | 0 src/{ => server}/plugins/fusion/fusion_sensor.h | 0 .../plugins/fusion/hardware_fusion_sensor.html | 0 src/{ => server}/plugins/geo/CMakeLists.txt | 0 src/{ => server}/plugins/geo/geo_sensor.cpp | 0 src/{ => server}/plugins/geo/geo_sensor.h | 0 src/{ => server}/plugins/gravity/CMakeLists.txt | 0 .../plugins/gravity/gravity_sensor.cpp | 0 src/{ => server}/plugins/gravity/gravity_sensor.h | 0 src/{ => server}/plugins/gyro/CMakeLists.txt | 0 src/{ => server}/plugins/gyro/gyro_sensor.cpp | 0 src/{ => server}/plugins/gyro/gyro_sensor.h | 0 src/{ => server}/plugins/light/CMakeLists.txt | 0 src/{ => server}/plugins/light/light_sensor.cpp | 0 src/{ => server}/plugins/light/light_sensor.h | 0 .../plugins/linear_accel/CMakeLists.txt | 0 .../plugins/linear_accel/linear_accel_sensor.cpp | 0 .../plugins/linear_accel/linear_accel_sensor.h | 0 .../plugins/orientation/CMakeLists.txt | 0 .../plugins/orientation/orientation_sensor.cpp | 0 .../plugins/orientation/orientation_sensor.h | 0 src/{ => server}/plugins/pressure/CMakeLists.txt | 0 .../plugins/pressure/pressure_sensor.cpp | 0 .../plugins/pressure/pressure_sensor.h | 0 src/{ => server}/plugins/proxi/CMakeLists.txt | 0 src/{ => server}/plugins/proxi/proxi_sensor.cpp | 0 src/{ => server}/plugins/proxi/proxi_sensor.h | 0 .../plugins/rotation_vector/CMakeLists.txt | 0 .../rotation_vector/gaming_rv/CMakeLists.txt | 0 .../rotation_vector/gaming_rv/gaming_rv_sensor.cpp | 0 .../rotation_vector/gaming_rv/gaming_rv_sensor.h | 0 .../rotation_vector/geomagnetic_rv/CMakeLists.txt | 0 .../geomagnetic_rv/geomagnetic_rv_sensor.cpp | 0 .../geomagnetic_rv/geomagnetic_rv_sensor.h | 0 .../plugins/rotation_vector/rv/CMakeLists.txt | 0 .../plugins/rotation_vector/rv/rv_sensor.cpp | 0 .../plugins/rotation_vector/rv/rv_sensor.h | 0 .../plugins/rotation_vector/rv_raw/CMakeLists.txt | 0 .../rotation_vector/rv_raw/rv_raw_sensor.cpp | 0 .../plugins/rotation_vector/rv_raw/rv_raw_sensor.h | 0 .../plugins/temperature/CMakeLists.txt | 0 .../plugins/temperature/temperature_sensor.cpp | 0 .../plugins/temperature/temperature_sensor.h | 0 src/{ => server}/plugins/tilt/CMakeLists.txt | 0 src/{ => server}/plugins/tilt/tilt_sensor.cpp | 0 src/{ => server}/plugins/tilt/tilt_sensor.h | 0 .../plugins/ultraviolet/CMakeLists.txt | 0 .../plugins/ultraviolet/ultraviolet_sensor.cpp | 0 .../plugins/ultraviolet/ultraviolet_sensor.h | 0 src/{ => server}/plugins/uncal_gyro/CMakeLists.txt | 0 .../plugins/uncal_gyro/uncal_gyro_sensor.cpp | 0 .../plugins/uncal_gyro/uncal_gyro_sensor.h | 0 src/{shared => server}/sensor_base.cpp | 0 src/{shared => server}/sensor_base.h | 0 .../sensor_fusion/CMakeLists.txt | 0 .../data/100ms/gravity/single_roll_throw/accel.txt | 0 .../data/100ms/gravity/single_roll_throw/gyro.txt | 0 .../100ms/gravity/single_roll_throw/magnetic.txt | 0 .../100ms/linear_acceleration/move_x_y_z/accel.txt | 0 .../100ms/linear_acceleration/move_x_y_z/gyro.txt | 0 .../linear_acceleration/move_x_y_z/magnetic.txt | 0 .../100ms/orientation/roll_pitch_yaw/accel.txt | 0 .../data/100ms/orientation/roll_pitch_yaw/gyro.txt | 0 .../100ms/orientation/roll_pitch_yaw/magnetic.txt | 0 .../data/25ms/pedo/Climb_stairs_down/In_hand/accel | 0 .../data/25ms/pedo/Climb_stairs_down/In_hand/gyro | 0 .../25ms/pedo/Climb_stairs_down/In_hand/magnetic | 0 .../25ms/pedo/Climb_stairs_down/Pant_pocket/accel | 0 .../25ms/pedo/Climb_stairs_down/Pant_pocket/gyro | 0 .../pedo/Climb_stairs_down/Pant_pocket/magnetic | 0 .../25ms/pedo/Climb_stairs_down/Shirt_pocket/accel | 0 .../25ms/pedo/Climb_stairs_down/Shirt_pocket/gyro | 0 .../pedo/Climb_stairs_down/Shirt_pocket/magnetic | 0 .../pedo/Climb_stairs_down/While_talking/accel | 0 .../25ms/pedo/Climb_stairs_down/While_talking/gyro | 0 .../pedo/Climb_stairs_down/While_talking/magnetic | 0 .../data/25ms/pedo/Climb_stairs_up/In_hand/accel | 0 .../data/25ms/pedo/Climb_stairs_up/In_hand/gyro | 0 .../25ms/pedo/Climb_stairs_up/In_hand/magnetic | 0 .../25ms/pedo/Climb_stairs_up/Pant_pocket/accel | 0 .../25ms/pedo/Climb_stairs_up/Pant_pocket/gyro | 0 .../25ms/pedo/Climb_stairs_up/Pant_pocket/magnetic | 0 .../25ms/pedo/Climb_stairs_up/Shirt_pocket/accel | 0 .../25ms/pedo/Climb_stairs_up/Shirt_pocket/gyro | 0 .../pedo/Climb_stairs_up/Shirt_pocket/magnetic | 0 .../25ms/pedo/Climb_stairs_up/While_talking/accel | 0 .../25ms/pedo/Climb_stairs_up/While_talking/gyro | 0 .../pedo/Climb_stairs_up/While_talking/magnetic | 0 .../design/data/25ms/pedo/Walk_fast/In_hand/accel | 0 .../design/data/25ms/pedo/Walk_fast/In_hand/gyro | 0 .../data/25ms/pedo/Walk_fast/In_hand/magnetic | 0 .../data/25ms/pedo/Walk_fast/Pant_pocket/accel | 0 .../data/25ms/pedo/Walk_fast/Pant_pocket/gyro | 0 .../data/25ms/pedo/Walk_fast/Pant_pocket/magnetic | 0 .../data/25ms/pedo/Walk_fast/Shirt_pocket/accel | 0 .../data/25ms/pedo/Walk_fast/Shirt_pocket/gyro | 0 .../data/25ms/pedo/Walk_fast/Shirt_pocket/magnetic | 0 .../data/25ms/pedo/Walk_fast/While_talking/accel | 0 .../data/25ms/pedo/Walk_fast/While_talking/gyro | 0 .../25ms/pedo/Walk_fast/While_talking/magnetic | 0 .../design/data/25ms/pedo/Walk_slow/In_hand/accel | 0 .../design/data/25ms/pedo/Walk_slow/In_hand/gyro | 0 .../data/25ms/pedo/Walk_slow/In_hand/magnetic | 0 .../data/25ms/pedo/Walk_slow/Pant_pocket/accel | 0 .../data/25ms/pedo/Walk_slow/Pant_pocket/gyro | 0 .../data/25ms/pedo/Walk_slow/Pant_pocket/magnetic | 0 .../data/25ms/pedo/Walk_slow/Shirt_pocket/accel | 0 .../data/25ms/pedo/Walk_slow/Shirt_pocket/gyro | 0 .../data/25ms/pedo/Walk_slow/Shirt_pocket/magnetic | 0 .../data/25ms/pedo/Walk_slow/While_talking/accel | 0 .../data/25ms/pedo/Walk_slow/While_talking/gyro | 0 .../25ms/pedo/Walk_slow/While_talking/magnetic | 0 ...ock_diagram_gravity_and_linear_acceleration.png | Bin .../block_diagram_orientation_estimation.png | Bin .../documentation/diagram/device_orientation.png | Bin .../documentation/diagram/kalman_filter_stages.png | Bin .../diagram/orientation_effect_on_gravity.png | Bin .../projection_diagram_gravity_computation.png | Bin .../design/documentation/equation/equation_1.png | Bin .../design/documentation/equation/equation_10.png | Bin .../design/documentation/equation/equation_11.png | Bin .../design/documentation/equation/equation_12.png | Bin .../design/documentation/equation/equation_13.png | Bin .../documentation/equation/equation_13_updated.png | Bin .../design/documentation/equation/equation_14.png | Bin .../design/documentation/equation/equation_15.png | Bin .../design/documentation/equation/equation_16.png | Bin .../design/documentation/equation/equation_17.png | Bin .../design/documentation/equation/equation_18.png | Bin .../design/documentation/equation/equation_19.png | Bin .../design/documentation/equation/equation_2.png | Bin .../design/documentation/equation/equation_20.png | Bin .../design/documentation/equation/equation_21.png | Bin .../design/documentation/equation/equation_22.png | Bin .../design/documentation/equation/equation_23.png | Bin .../design/documentation/equation/equation_24.png | Bin .../design/documentation/equation/equation_25.png | Bin .../design/documentation/equation/equation_26.png | Bin .../design/documentation/equation/equation_27.png | Bin .../design/documentation/equation/equation_28.png | Bin .../design/documentation/equation/equation_29.png | Bin .../design/documentation/equation/equation_3.png | Bin .../design/documentation/equation/equation_30.png | Bin .../design/documentation/equation/equation_31.png | Bin .../design/documentation/equation/equation_32.png | Bin .../design/documentation/equation/equation_33.png | Bin .../design/documentation/equation/equation_34.png | Bin .../design/documentation/equation/equation_35.png | Bin .../design/documentation/equation/equation_36.png | Bin .../design/documentation/equation/equation_37.png | Bin .../design/documentation/equation/equation_38.png | Bin .../design/documentation/equation/equation_39.png | Bin .../design/documentation/equation/equation_4.png | Bin .../design/documentation/equation/equation_40.png | Bin .../design/documentation/equation/equation_5.png | Bin .../design/documentation/equation/equation_6.png | Bin .../design/documentation/equation/equation_7.png | Bin .../design/documentation/equation/equation_8.png | Bin .../design/documentation/equation/equation_9.png | Bin .../design/documentation/sensor_fusion.htm | 0 .../sensor_fusion/design/lib/axis_rot2quat.m | 0 .../sensor_fusion/design/lib/estimate_gaming_rv.m | 0 .../design/lib/estimate_geomagnetic_rv.m | 0 .../sensor_fusion/design/lib/estimate_gravity.m | 0 .../design/lib/estimate_linear_acceleration.m | 0 .../design/lib/estimate_orientation.m | 0 .../sensor_fusion/design/lib/euler2quat.m | 0 .../sensor_fusion/design/lib/quat2euler.m | 0 .../sensor_fusion/design/lib/quat2rot_mat.m | 0 .../sensor_fusion/design/lib/quat_prod.m | 0 .../sensor_fusion/design/lib/rot_mat2quat.m | 0 .../sensor_fusion/design/lib/sf_pedometer.m | 0 .../sensor_fusion/design/readme | 0 .../sensor_fusion/design/sf_gaming_rv.m | 0 .../sensor_fusion/design/sf_geomagnetic_rv.m | 0 .../sensor_fusion/design/sf_gravity.m | 0 .../sensor_fusion/design/sf_linear_acceleration.m | 0 .../sensor_fusion/design/sf_orientation.m | 0 .../sensor_fusion/euler_angles.cpp | 0 .../sensor_fusion/euler_angles.h | 0 src/{plugins => server}/sensor_fusion/matrix.cpp | 0 src/{plugins => server}/sensor_fusion/matrix.h | 0 .../sensor_fusion/orientation_filter.cpp | 0 .../sensor_fusion/orientation_filter.h | 0 .../sensor_fusion/quaternion.cpp | 0 src/{plugins => server}/sensor_fusion/quaternion.h | 0 .../sensor_fusion/rotation_matrix.cpp | 0 .../sensor_fusion/rotation_matrix.h | 0 .../sensor_fusion/sensor_data.cpp | 0 .../sensor_fusion/sensor_data.h | 0 .../sensor_fusion/test/gravity_sensor.cpp | 0 .../sensor_fusion/test/gravity_sensor.h | 0 .../test/linear_acceleration_sensor.cpp | 0 .../test/linear_acceleration_sensor.h | 0 .../sensor_fusion/test/orientation_sensor.cpp | 0 .../sensor_fusion/test/orientation_sensor.h | 0 .../test/test_projects/euler_angles_test/.cproject | 0 .../test/test_projects/euler_angles_test/.project | 0 .../euler_angles_test/euler_angles_main.cpp | 0 .../test_projects/gravity_sensor_test/.cproject | 0 .../test_projects/gravity_sensor_test/.project | 0 .../gravity_sensor_test/gravity_sensor_main.cpp | 0 .../linear_acceleration_sensor_test/.cproject | 0 .../linear_acceleration_sensor_test/.project | 0 .../linear_acceleration_sensor_main.cpp | 0 .../test/test_projects/matrix_test/.cproject | 0 .../test/test_projects/matrix_test/.project | 0 .../test/test_projects/matrix_test/matrix_main.cpp | 0 .../orientation_sensor_test/.cproject | 0 .../test_projects/orientation_sensor_test/.project | 0 .../orientation_sensor_main.cpp | 0 .../test/test_projects/quaternion_test/.cproject | 0 .../test/test_projects/quaternion_test/.project | 0 .../quaternion_test/quaternion_main.cpp | 0 .../test_projects/rotation_matrix_test/.cproject | 0 .../test_projects/rotation_matrix_test/.project | 0 .../rotation_matrix_test/rotation_matrix_main.cpp | 0 .../test/test_projects/sensor_data_test/.cproject | 0 .../test/test_projects/sensor_data_test/.project | 0 .../sensor_data_test/sensor_data_main.cpp | 0 .../test/test_projects/vector_test/.cproject | 0 .../test/test_projects/vector_test/.project | 0 .../test/test_projects/vector_test/vector_main.cpp | 0 src/{plugins => server}/sensor_fusion/vector.cpp | 0 src/{plugins => server}/sensor_fusion/vector.h | 0 src/{shared => server}/sensord-server.pc.in | 0 src/{shared => server}/virtual_sensor.cpp | 0 src/{shared => server}/virtual_sensor.h | 0 src/{shared => server}/worker_thread.cpp | 0 src/{shared => server}/worker_thread.h | 0 src/shared/csensor_config.cpp | 279 --------------------- src/shared/csensor_config.h | 95 ------- src/shared/iio_common.cpp | 208 --------------- src/shared/iio_common.h | 99 -------- src/shared/sensor_accel.h | 53 ---- src/shared/sensor_auto_rotation.h | 60 ----- src/shared/sensor_bio_led_red.h | 52 ---- src/shared/sensor_context.h | 56 ----- src/shared/sensor_fusion.h | 59 ----- src/shared/sensor_gaming_rv.h | 35 --- src/shared/sensor_geomag.h | 54 ---- src/shared/sensor_geomagnetic_rv.h | 51 ---- src/shared/sensor_gravity.h | 52 ---- src/shared/sensor_gyro.h | 53 ---- src/shared/sensor_internal.h | 21 +- src/shared/sensor_internal_deprecated.h | 23 +- src/shared/sensor_light.h | 58 ----- src/shared/sensor_linear_accel.h | 52 ---- src/shared/sensor_motion.h | 150 ----------- src/shared/sensor_orientation.h | 53 ---- src/shared/sensor_pressure.h | 52 ---- src/shared/sensor_proxi.h | 60 ----- src/shared/sensor_rv.h | 53 ---- src/shared/sensor_temperature.h | 52 ---- src/shared/sensor_tilt.h | 52 ---- src/shared/sensor_types.h | 267 ++++++++++++++++++++ src/shared/sensor_ultraviolet.h | 52 ---- src/shared/sensor_uncal_gyro.h | 52 ---- 290 files changed, 269 insertions(+), 1934 deletions(-) rename src/{shared => server}/cclient_info_manager.cpp (100%) rename src/{shared => server}/cclient_info_manager.h (100%) rename src/{shared => server}/cclient_sensor_record.cpp (100%) rename src/{shared => server}/cclient_sensor_record.h (100%) rename src/{shared => server}/cconfig.cpp (100%) rename src/{shared => server}/cconfig.h (100%) rename src/{shared => server}/cplugin_info_list.cpp (100%) rename src/{shared => server}/cplugin_info_list.h (100%) rename src/{shared => server}/csensor_event_dispatcher.cpp (100%) rename src/{shared => server}/csensor_event_dispatcher.h (100%) rename src/{shared => server}/csensor_event_queue.cpp (100%) rename src/{shared => server}/csensor_event_queue.h (100%) rename src/{shared => server}/csensor_usage.cpp (100%) rename src/{shared => server}/csensor_usage.h (100%) rename src/{shared => server}/cvirtual_sensor_config.cpp (100%) rename src/{shared => server}/cvirtual_sensor_config.h (100%) rename src/{shared => server}/physical_sensor.cpp (100%) rename src/{shared => server}/physical_sensor.h (100%) rename src/{ => server}/plugins/accel/CMakeLists.txt (100%) rename src/{ => server}/plugins/accel/accel_sensor.cpp (100%) rename src/{ => server}/plugins/accel/accel_sensor.h (100%) rename src/{ => server}/plugins/auto_rotation/CMakeLists.txt (100%) rename src/{ => server}/plugins/auto_rotation/auto_rotation_alg.cpp (100%) rename src/{ => server}/plugins/auto_rotation/auto_rotation_alg.h (100%) rename src/{ => server}/plugins/auto_rotation/auto_rotation_alg_emul.cpp (100%) rename src/{ => server}/plugins/auto_rotation/auto_rotation_alg_emul.h (100%) rename src/{ => server}/plugins/auto_rotation/auto_rotation_sensor.cpp (100%) rename src/{ => server}/plugins/auto_rotation/auto_rotation_sensor.h (100%) rename src/{ => server}/plugins/bio_led_red/CMakeLists.txt (100%) rename src/{ => server}/plugins/bio_led_red/bio_led_red_sensor.cpp (100%) rename src/{ => server}/plugins/bio_led_red/bio_led_red_sensor.h (100%) rename src/{ => server}/plugins/fusion/CMakeLists.txt (100%) rename src/{ => server}/plugins/fusion/fusion_sensor.cpp (100%) rename src/{ => server}/plugins/fusion/fusion_sensor.h (100%) rename src/{ => server}/plugins/fusion/hardware_fusion_sensor.html (100%) rename src/{ => server}/plugins/geo/CMakeLists.txt (100%) rename src/{ => server}/plugins/geo/geo_sensor.cpp (100%) rename src/{ => server}/plugins/geo/geo_sensor.h (100%) rename src/{ => server}/plugins/gravity/CMakeLists.txt (100%) rename src/{ => server}/plugins/gravity/gravity_sensor.cpp (100%) rename src/{ => server}/plugins/gravity/gravity_sensor.h (100%) rename src/{ => server}/plugins/gyro/CMakeLists.txt (100%) rename src/{ => server}/plugins/gyro/gyro_sensor.cpp (100%) rename src/{ => server}/plugins/gyro/gyro_sensor.h (100%) rename src/{ => server}/plugins/light/CMakeLists.txt (100%) rename src/{ => server}/plugins/light/light_sensor.cpp (100%) rename src/{ => server}/plugins/light/light_sensor.h (100%) rename src/{ => server}/plugins/linear_accel/CMakeLists.txt (100%) rename src/{ => server}/plugins/linear_accel/linear_accel_sensor.cpp (100%) rename src/{ => server}/plugins/linear_accel/linear_accel_sensor.h (100%) rename src/{ => server}/plugins/orientation/CMakeLists.txt (100%) rename src/{ => server}/plugins/orientation/orientation_sensor.cpp (100%) rename src/{ => server}/plugins/orientation/orientation_sensor.h (100%) rename src/{ => server}/plugins/pressure/CMakeLists.txt (100%) rename src/{ => server}/plugins/pressure/pressure_sensor.cpp (100%) rename src/{ => server}/plugins/pressure/pressure_sensor.h (100%) rename src/{ => server}/plugins/proxi/CMakeLists.txt (100%) rename src/{ => server}/plugins/proxi/proxi_sensor.cpp (100%) rename src/{ => server}/plugins/proxi/proxi_sensor.h (100%) rename src/{ => server}/plugins/rotation_vector/CMakeLists.txt (100%) rename src/{ => server}/plugins/rotation_vector/gaming_rv/CMakeLists.txt (100%) rename src/{ => server}/plugins/rotation_vector/gaming_rv/gaming_rv_sensor.cpp (100%) rename src/{ => server}/plugins/rotation_vector/gaming_rv/gaming_rv_sensor.h (100%) rename src/{ => server}/plugins/rotation_vector/geomagnetic_rv/CMakeLists.txt (100%) rename src/{ => server}/plugins/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp (100%) rename src/{ => server}/plugins/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.h (100%) rename src/{ => server}/plugins/rotation_vector/rv/CMakeLists.txt (100%) rename src/{ => server}/plugins/rotation_vector/rv/rv_sensor.cpp (100%) rename src/{ => server}/plugins/rotation_vector/rv/rv_sensor.h (100%) rename src/{ => server}/plugins/rotation_vector/rv_raw/CMakeLists.txt (100%) rename src/{ => server}/plugins/rotation_vector/rv_raw/rv_raw_sensor.cpp (100%) rename src/{ => server}/plugins/rotation_vector/rv_raw/rv_raw_sensor.h (100%) rename src/{ => server}/plugins/temperature/CMakeLists.txt (100%) rename src/{ => server}/plugins/temperature/temperature_sensor.cpp (100%) rename src/{ => server}/plugins/temperature/temperature_sensor.h (100%) rename src/{ => server}/plugins/tilt/CMakeLists.txt (100%) rename src/{ => server}/plugins/tilt/tilt_sensor.cpp (100%) rename src/{ => server}/plugins/tilt/tilt_sensor.h (100%) rename src/{ => server}/plugins/ultraviolet/CMakeLists.txt (100%) rename src/{ => server}/plugins/ultraviolet/ultraviolet_sensor.cpp (100%) rename src/{ => server}/plugins/ultraviolet/ultraviolet_sensor.h (100%) rename src/{ => server}/plugins/uncal_gyro/CMakeLists.txt (100%) rename src/{ => server}/plugins/uncal_gyro/uncal_gyro_sensor.cpp (100%) rename src/{ => server}/plugins/uncal_gyro/uncal_gyro_sensor.h (100%) rename src/{shared => server}/sensor_base.cpp (100%) rename src/{shared => server}/sensor_base.h (100%) rename src/{plugins => server}/sensor_fusion/CMakeLists.txt (100%) rename src/{plugins => server}/sensor_fusion/design/data/100ms/gravity/single_roll_throw/accel.txt (100%) rename src/{plugins => server}/sensor_fusion/design/data/100ms/gravity/single_roll_throw/gyro.txt (100%) rename src/{plugins => server}/sensor_fusion/design/data/100ms/gravity/single_roll_throw/magnetic.txt (100%) rename src/{plugins => server}/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/accel.txt (100%) rename src/{plugins => server}/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/gyro.txt (100%) rename src/{plugins => server}/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/magnetic.txt (100%) rename src/{plugins => server}/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/accel.txt (100%) rename src/{plugins => server}/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/gyro.txt (100%) rename src/{plugins => server}/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/magnetic.txt (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/accel (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/gyro (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/magnetic (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/accel (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/gyro (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/magnetic (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/accel (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/gyro (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/magnetic (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/accel (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/gyro (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/magnetic (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/accel (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/gyro (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/magnetic (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/accel (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/gyro (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/magnetic (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/accel (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/gyro (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/magnetic (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/accel (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/gyro (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/magnetic (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/accel (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/gyro (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/magnetic (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/accel (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/gyro (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/magnetic (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/accel (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/gyro (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/magnetic (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/accel (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/gyro (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/magnetic (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/accel (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/gyro (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/magnetic (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/accel (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/gyro (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/magnetic (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/accel (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/gyro (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/magnetic (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/accel (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/gyro (100%) rename src/{plugins => server}/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/magnetic (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/diagram/block_diagram_gravity_and_linear_acceleration.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/diagram/block_diagram_orientation_estimation.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/diagram/device_orientation.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/diagram/kalman_filter_stages.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/diagram/orientation_effect_on_gravity.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/diagram/projection_diagram_gravity_computation.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_1.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_10.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_11.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_12.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_13.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_13_updated.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_14.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_15.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_16.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_17.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_18.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_19.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_2.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_20.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_21.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_22.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_23.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_24.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_25.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_26.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_27.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_28.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_29.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_3.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_30.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_31.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_32.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_33.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_34.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_35.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_36.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_37.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_38.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_39.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_4.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_40.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_5.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_6.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_7.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_8.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/equation/equation_9.png (100%) rename src/{plugins => server}/sensor_fusion/design/documentation/sensor_fusion.htm (100%) rename src/{plugins => server}/sensor_fusion/design/lib/axis_rot2quat.m (100%) rename src/{plugins => server}/sensor_fusion/design/lib/estimate_gaming_rv.m (100%) rename src/{plugins => server}/sensor_fusion/design/lib/estimate_geomagnetic_rv.m (100%) rename src/{plugins => server}/sensor_fusion/design/lib/estimate_gravity.m (100%) rename src/{plugins => server}/sensor_fusion/design/lib/estimate_linear_acceleration.m (100%) rename src/{plugins => server}/sensor_fusion/design/lib/estimate_orientation.m (100%) rename src/{plugins => server}/sensor_fusion/design/lib/euler2quat.m (100%) rename src/{plugins => server}/sensor_fusion/design/lib/quat2euler.m (100%) rename src/{plugins => server}/sensor_fusion/design/lib/quat2rot_mat.m (100%) rename src/{plugins => server}/sensor_fusion/design/lib/quat_prod.m (100%) rename src/{plugins => server}/sensor_fusion/design/lib/rot_mat2quat.m (100%) rename src/{plugins => server}/sensor_fusion/design/lib/sf_pedometer.m (100%) rename src/{plugins => server}/sensor_fusion/design/readme (100%) rename src/{plugins => server}/sensor_fusion/design/sf_gaming_rv.m (100%) rename src/{plugins => server}/sensor_fusion/design/sf_geomagnetic_rv.m (100%) rename src/{plugins => server}/sensor_fusion/design/sf_gravity.m (100%) rename src/{plugins => server}/sensor_fusion/design/sf_linear_acceleration.m (100%) rename src/{plugins => server}/sensor_fusion/design/sf_orientation.m (100%) rename src/{plugins => server}/sensor_fusion/euler_angles.cpp (100%) rename src/{plugins => server}/sensor_fusion/euler_angles.h (100%) rename src/{plugins => server}/sensor_fusion/matrix.cpp (100%) rename src/{plugins => server}/sensor_fusion/matrix.h (100%) rename src/{plugins => server}/sensor_fusion/orientation_filter.cpp (100%) rename src/{plugins => server}/sensor_fusion/orientation_filter.h (100%) rename src/{plugins => server}/sensor_fusion/quaternion.cpp (100%) rename src/{plugins => server}/sensor_fusion/quaternion.h (100%) rename src/{plugins => server}/sensor_fusion/rotation_matrix.cpp (100%) rename src/{plugins => server}/sensor_fusion/rotation_matrix.h (100%) rename src/{plugins => server}/sensor_fusion/sensor_data.cpp (100%) rename src/{plugins => server}/sensor_fusion/sensor_data.h (100%) rename src/{plugins => server}/sensor_fusion/test/gravity_sensor.cpp (100%) rename src/{plugins => server}/sensor_fusion/test/gravity_sensor.h (100%) rename src/{plugins => server}/sensor_fusion/test/linear_acceleration_sensor.cpp (100%) rename src/{plugins => server}/sensor_fusion/test/linear_acceleration_sensor.h (100%) rename src/{plugins => server}/sensor_fusion/test/orientation_sensor.cpp (100%) rename src/{plugins => server}/sensor_fusion/test/orientation_sensor.h (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/euler_angles_test/.cproject (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/euler_angles_test/.project (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/euler_angles_test/euler_angles_main.cpp (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/gravity_sensor_test/.cproject (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/gravity_sensor_test/.project (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/gravity_sensor_test/gravity_sensor_main.cpp (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.cproject (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.project (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/linear_acceleration_sensor_main.cpp (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/matrix_test/.cproject (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/matrix_test/.project (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/matrix_test/matrix_main.cpp (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/orientation_sensor_test/.cproject (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/orientation_sensor_test/.project (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/orientation_sensor_test/orientation_sensor_main.cpp (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/quaternion_test/.cproject (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/quaternion_test/.project (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/quaternion_test/quaternion_main.cpp (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/rotation_matrix_test/.cproject (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/rotation_matrix_test/.project (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/rotation_matrix_test/rotation_matrix_main.cpp (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/sensor_data_test/.cproject (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/sensor_data_test/.project (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/sensor_data_test/sensor_data_main.cpp (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/vector_test/.cproject (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/vector_test/.project (100%) rename src/{plugins => server}/sensor_fusion/test/test_projects/vector_test/vector_main.cpp (100%) rename src/{plugins => server}/sensor_fusion/vector.cpp (100%) rename src/{plugins => server}/sensor_fusion/vector.h (100%) rename src/{shared => server}/sensord-server.pc.in (100%) rename src/{shared => server}/virtual_sensor.cpp (100%) rename src/{shared => server}/virtual_sensor.h (100%) rename src/{shared => server}/worker_thread.cpp (100%) rename src/{shared => server}/worker_thread.h (100%) delete mode 100755 src/shared/csensor_config.cpp delete mode 100755 src/shared/csensor_config.h delete mode 100755 src/shared/iio_common.cpp delete mode 100755 src/shared/iio_common.h delete mode 100755 src/shared/sensor_accel.h delete mode 100755 src/shared/sensor_auto_rotation.h delete mode 100644 src/shared/sensor_bio_led_red.h delete mode 100755 src/shared/sensor_context.h delete mode 100755 src/shared/sensor_fusion.h delete mode 100755 src/shared/sensor_gaming_rv.h delete mode 100755 src/shared/sensor_geomag.h delete mode 100755 src/shared/sensor_geomagnetic_rv.h delete mode 100755 src/shared/sensor_gravity.h delete mode 100755 src/shared/sensor_gyro.h delete mode 100755 src/shared/sensor_light.h delete mode 100755 src/shared/sensor_linear_accel.h delete mode 100755 src/shared/sensor_motion.h delete mode 100755 src/shared/sensor_orientation.h delete mode 100755 src/shared/sensor_pressure.h delete mode 100755 src/shared/sensor_proxi.h delete mode 100755 src/shared/sensor_rv.h delete mode 100755 src/shared/sensor_temperature.h delete mode 100644 src/shared/sensor_tilt.h create mode 100644 src/shared/sensor_types.h delete mode 100644 src/shared/sensor_ultraviolet.h delete mode 100644 src/shared/sensor_uncal_gyro.h diff --git a/src/shared/cclient_info_manager.cpp b/src/server/cclient_info_manager.cpp similarity index 100% rename from src/shared/cclient_info_manager.cpp rename to src/server/cclient_info_manager.cpp diff --git a/src/shared/cclient_info_manager.h b/src/server/cclient_info_manager.h similarity index 100% rename from src/shared/cclient_info_manager.h rename to src/server/cclient_info_manager.h diff --git a/src/shared/cclient_sensor_record.cpp b/src/server/cclient_sensor_record.cpp similarity index 100% rename from src/shared/cclient_sensor_record.cpp rename to src/server/cclient_sensor_record.cpp diff --git a/src/shared/cclient_sensor_record.h b/src/server/cclient_sensor_record.h similarity index 100% rename from src/shared/cclient_sensor_record.h rename to src/server/cclient_sensor_record.h diff --git a/src/shared/cconfig.cpp b/src/server/cconfig.cpp similarity index 100% rename from src/shared/cconfig.cpp rename to src/server/cconfig.cpp diff --git a/src/shared/cconfig.h b/src/server/cconfig.h similarity index 100% rename from src/shared/cconfig.h rename to src/server/cconfig.h diff --git a/src/shared/cplugin_info_list.cpp b/src/server/cplugin_info_list.cpp similarity index 100% rename from src/shared/cplugin_info_list.cpp rename to src/server/cplugin_info_list.cpp diff --git a/src/shared/cplugin_info_list.h b/src/server/cplugin_info_list.h similarity index 100% rename from src/shared/cplugin_info_list.h rename to src/server/cplugin_info_list.h diff --git a/src/shared/csensor_event_dispatcher.cpp b/src/server/csensor_event_dispatcher.cpp similarity index 100% rename from src/shared/csensor_event_dispatcher.cpp rename to src/server/csensor_event_dispatcher.cpp diff --git a/src/shared/csensor_event_dispatcher.h b/src/server/csensor_event_dispatcher.h similarity index 100% rename from src/shared/csensor_event_dispatcher.h rename to src/server/csensor_event_dispatcher.h diff --git a/src/shared/csensor_event_queue.cpp b/src/server/csensor_event_queue.cpp similarity index 100% rename from src/shared/csensor_event_queue.cpp rename to src/server/csensor_event_queue.cpp diff --git a/src/shared/csensor_event_queue.h b/src/server/csensor_event_queue.h similarity index 100% rename from src/shared/csensor_event_queue.h rename to src/server/csensor_event_queue.h diff --git a/src/shared/csensor_usage.cpp b/src/server/csensor_usage.cpp similarity index 100% rename from src/shared/csensor_usage.cpp rename to src/server/csensor_usage.cpp diff --git a/src/shared/csensor_usage.h b/src/server/csensor_usage.h similarity index 100% rename from src/shared/csensor_usage.h rename to src/server/csensor_usage.h diff --git a/src/shared/cvirtual_sensor_config.cpp b/src/server/cvirtual_sensor_config.cpp similarity index 100% rename from src/shared/cvirtual_sensor_config.cpp rename to src/server/cvirtual_sensor_config.cpp diff --git a/src/shared/cvirtual_sensor_config.h b/src/server/cvirtual_sensor_config.h similarity index 100% rename from src/shared/cvirtual_sensor_config.h rename to src/server/cvirtual_sensor_config.h diff --git a/src/shared/physical_sensor.cpp b/src/server/physical_sensor.cpp similarity index 100% rename from src/shared/physical_sensor.cpp rename to src/server/physical_sensor.cpp diff --git a/src/shared/physical_sensor.h b/src/server/physical_sensor.h similarity index 100% rename from src/shared/physical_sensor.h rename to src/server/physical_sensor.h diff --git a/src/plugins/accel/CMakeLists.txt b/src/server/plugins/accel/CMakeLists.txt similarity index 100% rename from src/plugins/accel/CMakeLists.txt rename to src/server/plugins/accel/CMakeLists.txt diff --git a/src/plugins/accel/accel_sensor.cpp b/src/server/plugins/accel/accel_sensor.cpp similarity index 100% rename from src/plugins/accel/accel_sensor.cpp rename to src/server/plugins/accel/accel_sensor.cpp diff --git a/src/plugins/accel/accel_sensor.h b/src/server/plugins/accel/accel_sensor.h similarity index 100% rename from src/plugins/accel/accel_sensor.h rename to src/server/plugins/accel/accel_sensor.h diff --git a/src/plugins/auto_rotation/CMakeLists.txt b/src/server/plugins/auto_rotation/CMakeLists.txt similarity index 100% rename from src/plugins/auto_rotation/CMakeLists.txt rename to src/server/plugins/auto_rotation/CMakeLists.txt diff --git a/src/plugins/auto_rotation/auto_rotation_alg.cpp b/src/server/plugins/auto_rotation/auto_rotation_alg.cpp similarity index 100% rename from src/plugins/auto_rotation/auto_rotation_alg.cpp rename to src/server/plugins/auto_rotation/auto_rotation_alg.cpp diff --git a/src/plugins/auto_rotation/auto_rotation_alg.h b/src/server/plugins/auto_rotation/auto_rotation_alg.h similarity index 100% rename from src/plugins/auto_rotation/auto_rotation_alg.h rename to src/server/plugins/auto_rotation/auto_rotation_alg.h diff --git a/src/plugins/auto_rotation/auto_rotation_alg_emul.cpp b/src/server/plugins/auto_rotation/auto_rotation_alg_emul.cpp similarity index 100% rename from src/plugins/auto_rotation/auto_rotation_alg_emul.cpp rename to src/server/plugins/auto_rotation/auto_rotation_alg_emul.cpp diff --git a/src/plugins/auto_rotation/auto_rotation_alg_emul.h b/src/server/plugins/auto_rotation/auto_rotation_alg_emul.h similarity index 100% rename from src/plugins/auto_rotation/auto_rotation_alg_emul.h rename to src/server/plugins/auto_rotation/auto_rotation_alg_emul.h diff --git a/src/plugins/auto_rotation/auto_rotation_sensor.cpp b/src/server/plugins/auto_rotation/auto_rotation_sensor.cpp similarity index 100% rename from src/plugins/auto_rotation/auto_rotation_sensor.cpp rename to src/server/plugins/auto_rotation/auto_rotation_sensor.cpp diff --git a/src/plugins/auto_rotation/auto_rotation_sensor.h b/src/server/plugins/auto_rotation/auto_rotation_sensor.h similarity index 100% rename from src/plugins/auto_rotation/auto_rotation_sensor.h rename to src/server/plugins/auto_rotation/auto_rotation_sensor.h diff --git a/src/plugins/bio_led_red/CMakeLists.txt b/src/server/plugins/bio_led_red/CMakeLists.txt similarity index 100% rename from src/plugins/bio_led_red/CMakeLists.txt rename to src/server/plugins/bio_led_red/CMakeLists.txt diff --git a/src/plugins/bio_led_red/bio_led_red_sensor.cpp b/src/server/plugins/bio_led_red/bio_led_red_sensor.cpp similarity index 100% rename from src/plugins/bio_led_red/bio_led_red_sensor.cpp rename to src/server/plugins/bio_led_red/bio_led_red_sensor.cpp diff --git a/src/plugins/bio_led_red/bio_led_red_sensor.h b/src/server/plugins/bio_led_red/bio_led_red_sensor.h similarity index 100% rename from src/plugins/bio_led_red/bio_led_red_sensor.h rename to src/server/plugins/bio_led_red/bio_led_red_sensor.h diff --git a/src/plugins/fusion/CMakeLists.txt b/src/server/plugins/fusion/CMakeLists.txt similarity index 100% rename from src/plugins/fusion/CMakeLists.txt rename to src/server/plugins/fusion/CMakeLists.txt diff --git a/src/plugins/fusion/fusion_sensor.cpp b/src/server/plugins/fusion/fusion_sensor.cpp similarity index 100% rename from src/plugins/fusion/fusion_sensor.cpp rename to src/server/plugins/fusion/fusion_sensor.cpp diff --git a/src/plugins/fusion/fusion_sensor.h b/src/server/plugins/fusion/fusion_sensor.h similarity index 100% rename from src/plugins/fusion/fusion_sensor.h rename to src/server/plugins/fusion/fusion_sensor.h diff --git a/src/plugins/fusion/hardware_fusion_sensor.html b/src/server/plugins/fusion/hardware_fusion_sensor.html similarity index 100% rename from src/plugins/fusion/hardware_fusion_sensor.html rename to src/server/plugins/fusion/hardware_fusion_sensor.html diff --git a/src/plugins/geo/CMakeLists.txt b/src/server/plugins/geo/CMakeLists.txt similarity index 100% rename from src/plugins/geo/CMakeLists.txt rename to src/server/plugins/geo/CMakeLists.txt diff --git a/src/plugins/geo/geo_sensor.cpp b/src/server/plugins/geo/geo_sensor.cpp similarity index 100% rename from src/plugins/geo/geo_sensor.cpp rename to src/server/plugins/geo/geo_sensor.cpp diff --git a/src/plugins/geo/geo_sensor.h b/src/server/plugins/geo/geo_sensor.h similarity index 100% rename from src/plugins/geo/geo_sensor.h rename to src/server/plugins/geo/geo_sensor.h diff --git a/src/plugins/gravity/CMakeLists.txt b/src/server/plugins/gravity/CMakeLists.txt similarity index 100% rename from src/plugins/gravity/CMakeLists.txt rename to src/server/plugins/gravity/CMakeLists.txt diff --git a/src/plugins/gravity/gravity_sensor.cpp b/src/server/plugins/gravity/gravity_sensor.cpp similarity index 100% rename from src/plugins/gravity/gravity_sensor.cpp rename to src/server/plugins/gravity/gravity_sensor.cpp diff --git a/src/plugins/gravity/gravity_sensor.h b/src/server/plugins/gravity/gravity_sensor.h similarity index 100% rename from src/plugins/gravity/gravity_sensor.h rename to src/server/plugins/gravity/gravity_sensor.h diff --git a/src/plugins/gyro/CMakeLists.txt b/src/server/plugins/gyro/CMakeLists.txt similarity index 100% rename from src/plugins/gyro/CMakeLists.txt rename to src/server/plugins/gyro/CMakeLists.txt diff --git a/src/plugins/gyro/gyro_sensor.cpp b/src/server/plugins/gyro/gyro_sensor.cpp similarity index 100% rename from src/plugins/gyro/gyro_sensor.cpp rename to src/server/plugins/gyro/gyro_sensor.cpp diff --git a/src/plugins/gyro/gyro_sensor.h b/src/server/plugins/gyro/gyro_sensor.h similarity index 100% rename from src/plugins/gyro/gyro_sensor.h rename to src/server/plugins/gyro/gyro_sensor.h diff --git a/src/plugins/light/CMakeLists.txt b/src/server/plugins/light/CMakeLists.txt similarity index 100% rename from src/plugins/light/CMakeLists.txt rename to src/server/plugins/light/CMakeLists.txt diff --git a/src/plugins/light/light_sensor.cpp b/src/server/plugins/light/light_sensor.cpp similarity index 100% rename from src/plugins/light/light_sensor.cpp rename to src/server/plugins/light/light_sensor.cpp diff --git a/src/plugins/light/light_sensor.h b/src/server/plugins/light/light_sensor.h similarity index 100% rename from src/plugins/light/light_sensor.h rename to src/server/plugins/light/light_sensor.h diff --git a/src/plugins/linear_accel/CMakeLists.txt b/src/server/plugins/linear_accel/CMakeLists.txt similarity index 100% rename from src/plugins/linear_accel/CMakeLists.txt rename to src/server/plugins/linear_accel/CMakeLists.txt diff --git a/src/plugins/linear_accel/linear_accel_sensor.cpp b/src/server/plugins/linear_accel/linear_accel_sensor.cpp similarity index 100% rename from src/plugins/linear_accel/linear_accel_sensor.cpp rename to src/server/plugins/linear_accel/linear_accel_sensor.cpp diff --git a/src/plugins/linear_accel/linear_accel_sensor.h b/src/server/plugins/linear_accel/linear_accel_sensor.h similarity index 100% rename from src/plugins/linear_accel/linear_accel_sensor.h rename to src/server/plugins/linear_accel/linear_accel_sensor.h diff --git a/src/plugins/orientation/CMakeLists.txt b/src/server/plugins/orientation/CMakeLists.txt similarity index 100% rename from src/plugins/orientation/CMakeLists.txt rename to src/server/plugins/orientation/CMakeLists.txt diff --git a/src/plugins/orientation/orientation_sensor.cpp b/src/server/plugins/orientation/orientation_sensor.cpp similarity index 100% rename from src/plugins/orientation/orientation_sensor.cpp rename to src/server/plugins/orientation/orientation_sensor.cpp diff --git a/src/plugins/orientation/orientation_sensor.h b/src/server/plugins/orientation/orientation_sensor.h similarity index 100% rename from src/plugins/orientation/orientation_sensor.h rename to src/server/plugins/orientation/orientation_sensor.h diff --git a/src/plugins/pressure/CMakeLists.txt b/src/server/plugins/pressure/CMakeLists.txt similarity index 100% rename from src/plugins/pressure/CMakeLists.txt rename to src/server/plugins/pressure/CMakeLists.txt diff --git a/src/plugins/pressure/pressure_sensor.cpp b/src/server/plugins/pressure/pressure_sensor.cpp similarity index 100% rename from src/plugins/pressure/pressure_sensor.cpp rename to src/server/plugins/pressure/pressure_sensor.cpp diff --git a/src/plugins/pressure/pressure_sensor.h b/src/server/plugins/pressure/pressure_sensor.h similarity index 100% rename from src/plugins/pressure/pressure_sensor.h rename to src/server/plugins/pressure/pressure_sensor.h diff --git a/src/plugins/proxi/CMakeLists.txt b/src/server/plugins/proxi/CMakeLists.txt similarity index 100% rename from src/plugins/proxi/CMakeLists.txt rename to src/server/plugins/proxi/CMakeLists.txt diff --git a/src/plugins/proxi/proxi_sensor.cpp b/src/server/plugins/proxi/proxi_sensor.cpp similarity index 100% rename from src/plugins/proxi/proxi_sensor.cpp rename to src/server/plugins/proxi/proxi_sensor.cpp diff --git a/src/plugins/proxi/proxi_sensor.h b/src/server/plugins/proxi/proxi_sensor.h similarity index 100% rename from src/plugins/proxi/proxi_sensor.h rename to src/server/plugins/proxi/proxi_sensor.h diff --git a/src/plugins/rotation_vector/CMakeLists.txt b/src/server/plugins/rotation_vector/CMakeLists.txt similarity index 100% rename from src/plugins/rotation_vector/CMakeLists.txt rename to src/server/plugins/rotation_vector/CMakeLists.txt diff --git a/src/plugins/rotation_vector/gaming_rv/CMakeLists.txt b/src/server/plugins/rotation_vector/gaming_rv/CMakeLists.txt similarity index 100% rename from src/plugins/rotation_vector/gaming_rv/CMakeLists.txt rename to src/server/plugins/rotation_vector/gaming_rv/CMakeLists.txt diff --git a/src/plugins/rotation_vector/gaming_rv/gaming_rv_sensor.cpp b/src/server/plugins/rotation_vector/gaming_rv/gaming_rv_sensor.cpp similarity index 100% rename from src/plugins/rotation_vector/gaming_rv/gaming_rv_sensor.cpp rename to src/server/plugins/rotation_vector/gaming_rv/gaming_rv_sensor.cpp diff --git a/src/plugins/rotation_vector/gaming_rv/gaming_rv_sensor.h b/src/server/plugins/rotation_vector/gaming_rv/gaming_rv_sensor.h similarity index 100% rename from src/plugins/rotation_vector/gaming_rv/gaming_rv_sensor.h rename to src/server/plugins/rotation_vector/gaming_rv/gaming_rv_sensor.h diff --git a/src/plugins/rotation_vector/geomagnetic_rv/CMakeLists.txt b/src/server/plugins/rotation_vector/geomagnetic_rv/CMakeLists.txt similarity index 100% rename from src/plugins/rotation_vector/geomagnetic_rv/CMakeLists.txt rename to src/server/plugins/rotation_vector/geomagnetic_rv/CMakeLists.txt diff --git a/src/plugins/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp b/src/server/plugins/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp similarity index 100% rename from src/plugins/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp rename to src/server/plugins/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp diff --git a/src/plugins/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.h b/src/server/plugins/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.h similarity index 100% rename from src/plugins/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.h rename to src/server/plugins/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.h diff --git a/src/plugins/rotation_vector/rv/CMakeLists.txt b/src/server/plugins/rotation_vector/rv/CMakeLists.txt similarity index 100% rename from src/plugins/rotation_vector/rv/CMakeLists.txt rename to src/server/plugins/rotation_vector/rv/CMakeLists.txt diff --git a/src/plugins/rotation_vector/rv/rv_sensor.cpp b/src/server/plugins/rotation_vector/rv/rv_sensor.cpp similarity index 100% rename from src/plugins/rotation_vector/rv/rv_sensor.cpp rename to src/server/plugins/rotation_vector/rv/rv_sensor.cpp diff --git a/src/plugins/rotation_vector/rv/rv_sensor.h b/src/server/plugins/rotation_vector/rv/rv_sensor.h similarity index 100% rename from src/plugins/rotation_vector/rv/rv_sensor.h rename to src/server/plugins/rotation_vector/rv/rv_sensor.h diff --git a/src/plugins/rotation_vector/rv_raw/CMakeLists.txt b/src/server/plugins/rotation_vector/rv_raw/CMakeLists.txt similarity index 100% rename from src/plugins/rotation_vector/rv_raw/CMakeLists.txt rename to src/server/plugins/rotation_vector/rv_raw/CMakeLists.txt diff --git a/src/plugins/rotation_vector/rv_raw/rv_raw_sensor.cpp b/src/server/plugins/rotation_vector/rv_raw/rv_raw_sensor.cpp similarity index 100% rename from src/plugins/rotation_vector/rv_raw/rv_raw_sensor.cpp rename to src/server/plugins/rotation_vector/rv_raw/rv_raw_sensor.cpp diff --git a/src/plugins/rotation_vector/rv_raw/rv_raw_sensor.h b/src/server/plugins/rotation_vector/rv_raw/rv_raw_sensor.h similarity index 100% rename from src/plugins/rotation_vector/rv_raw/rv_raw_sensor.h rename to src/server/plugins/rotation_vector/rv_raw/rv_raw_sensor.h diff --git a/src/plugins/temperature/CMakeLists.txt b/src/server/plugins/temperature/CMakeLists.txt similarity index 100% rename from src/plugins/temperature/CMakeLists.txt rename to src/server/plugins/temperature/CMakeLists.txt diff --git a/src/plugins/temperature/temperature_sensor.cpp b/src/server/plugins/temperature/temperature_sensor.cpp similarity index 100% rename from src/plugins/temperature/temperature_sensor.cpp rename to src/server/plugins/temperature/temperature_sensor.cpp diff --git a/src/plugins/temperature/temperature_sensor.h b/src/server/plugins/temperature/temperature_sensor.h similarity index 100% rename from src/plugins/temperature/temperature_sensor.h rename to src/server/plugins/temperature/temperature_sensor.h diff --git a/src/plugins/tilt/CMakeLists.txt b/src/server/plugins/tilt/CMakeLists.txt similarity index 100% rename from src/plugins/tilt/CMakeLists.txt rename to src/server/plugins/tilt/CMakeLists.txt diff --git a/src/plugins/tilt/tilt_sensor.cpp b/src/server/plugins/tilt/tilt_sensor.cpp similarity index 100% rename from src/plugins/tilt/tilt_sensor.cpp rename to src/server/plugins/tilt/tilt_sensor.cpp diff --git a/src/plugins/tilt/tilt_sensor.h b/src/server/plugins/tilt/tilt_sensor.h similarity index 100% rename from src/plugins/tilt/tilt_sensor.h rename to src/server/plugins/tilt/tilt_sensor.h diff --git a/src/plugins/ultraviolet/CMakeLists.txt b/src/server/plugins/ultraviolet/CMakeLists.txt similarity index 100% rename from src/plugins/ultraviolet/CMakeLists.txt rename to src/server/plugins/ultraviolet/CMakeLists.txt diff --git a/src/plugins/ultraviolet/ultraviolet_sensor.cpp b/src/server/plugins/ultraviolet/ultraviolet_sensor.cpp similarity index 100% rename from src/plugins/ultraviolet/ultraviolet_sensor.cpp rename to src/server/plugins/ultraviolet/ultraviolet_sensor.cpp diff --git a/src/plugins/ultraviolet/ultraviolet_sensor.h b/src/server/plugins/ultraviolet/ultraviolet_sensor.h similarity index 100% rename from src/plugins/ultraviolet/ultraviolet_sensor.h rename to src/server/plugins/ultraviolet/ultraviolet_sensor.h diff --git a/src/plugins/uncal_gyro/CMakeLists.txt b/src/server/plugins/uncal_gyro/CMakeLists.txt similarity index 100% rename from src/plugins/uncal_gyro/CMakeLists.txt rename to src/server/plugins/uncal_gyro/CMakeLists.txt diff --git a/src/plugins/uncal_gyro/uncal_gyro_sensor.cpp b/src/server/plugins/uncal_gyro/uncal_gyro_sensor.cpp similarity index 100% rename from src/plugins/uncal_gyro/uncal_gyro_sensor.cpp rename to src/server/plugins/uncal_gyro/uncal_gyro_sensor.cpp diff --git a/src/plugins/uncal_gyro/uncal_gyro_sensor.h b/src/server/plugins/uncal_gyro/uncal_gyro_sensor.h similarity index 100% rename from src/plugins/uncal_gyro/uncal_gyro_sensor.h rename to src/server/plugins/uncal_gyro/uncal_gyro_sensor.h diff --git a/src/shared/sensor_base.cpp b/src/server/sensor_base.cpp similarity index 100% rename from src/shared/sensor_base.cpp rename to src/server/sensor_base.cpp diff --git a/src/shared/sensor_base.h b/src/server/sensor_base.h similarity index 100% rename from src/shared/sensor_base.h rename to src/server/sensor_base.h diff --git a/src/plugins/sensor_fusion/CMakeLists.txt b/src/server/sensor_fusion/CMakeLists.txt similarity index 100% rename from src/plugins/sensor_fusion/CMakeLists.txt rename to src/server/sensor_fusion/CMakeLists.txt diff --git a/src/plugins/sensor_fusion/design/data/100ms/gravity/single_roll_throw/accel.txt b/src/server/sensor_fusion/design/data/100ms/gravity/single_roll_throw/accel.txt similarity index 100% rename from src/plugins/sensor_fusion/design/data/100ms/gravity/single_roll_throw/accel.txt rename to src/server/sensor_fusion/design/data/100ms/gravity/single_roll_throw/accel.txt diff --git a/src/plugins/sensor_fusion/design/data/100ms/gravity/single_roll_throw/gyro.txt b/src/server/sensor_fusion/design/data/100ms/gravity/single_roll_throw/gyro.txt similarity index 100% rename from src/plugins/sensor_fusion/design/data/100ms/gravity/single_roll_throw/gyro.txt rename to src/server/sensor_fusion/design/data/100ms/gravity/single_roll_throw/gyro.txt diff --git a/src/plugins/sensor_fusion/design/data/100ms/gravity/single_roll_throw/magnetic.txt b/src/server/sensor_fusion/design/data/100ms/gravity/single_roll_throw/magnetic.txt similarity index 100% rename from src/plugins/sensor_fusion/design/data/100ms/gravity/single_roll_throw/magnetic.txt rename to src/server/sensor_fusion/design/data/100ms/gravity/single_roll_throw/magnetic.txt diff --git a/src/plugins/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/accel.txt b/src/server/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/accel.txt similarity index 100% rename from src/plugins/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/accel.txt rename to src/server/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/accel.txt diff --git a/src/plugins/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/gyro.txt b/src/server/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/gyro.txt similarity index 100% rename from src/plugins/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/gyro.txt rename to src/server/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/gyro.txt diff --git a/src/plugins/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/magnetic.txt b/src/server/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/magnetic.txt similarity index 100% rename from src/plugins/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/magnetic.txt rename to src/server/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/magnetic.txt diff --git a/src/plugins/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/accel.txt b/src/server/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/accel.txt similarity index 100% rename from src/plugins/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/accel.txt rename to src/server/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/accel.txt diff --git a/src/plugins/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/gyro.txt b/src/server/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/gyro.txt similarity index 100% rename from src/plugins/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/gyro.txt rename to src/server/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/gyro.txt diff --git a/src/plugins/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/magnetic.txt b/src/server/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/magnetic.txt similarity index 100% rename from src/plugins/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/magnetic.txt rename to src/server/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/magnetic.txt diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/accel b/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/accel similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/accel rename to src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/accel diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/gyro b/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/gyro similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/gyro rename to src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/gyro diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/magnetic b/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/magnetic similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/magnetic rename to src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/magnetic diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/accel b/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/accel similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/accel rename to src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/accel diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/gyro b/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/gyro similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/gyro rename to src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/gyro diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/magnetic b/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/magnetic similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/magnetic rename to src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/magnetic diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/accel b/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/accel similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/accel rename to src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/accel diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/gyro b/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/gyro similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/gyro rename to src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/gyro diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/magnetic b/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/magnetic similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/magnetic rename to src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/magnetic diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/accel b/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/accel similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/accel rename to src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/accel diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/gyro b/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/gyro similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/gyro rename to src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/gyro diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/magnetic b/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/magnetic similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/magnetic rename to src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/magnetic diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/accel b/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/accel similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/accel rename to src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/accel diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/gyro b/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/gyro similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/gyro rename to src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/gyro diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/magnetic b/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/magnetic similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/magnetic rename to src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/magnetic diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/accel b/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/accel similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/accel rename to src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/accel diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/gyro b/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/gyro similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/gyro rename to src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/gyro diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/magnetic b/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/magnetic similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/magnetic rename to src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/magnetic diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/accel b/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/accel similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/accel rename to src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/accel diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/gyro b/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/gyro similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/gyro rename to src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/gyro diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/magnetic b/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/magnetic similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/magnetic rename to src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/magnetic diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/accel b/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/accel similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/accel rename to src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/accel diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/gyro b/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/gyro similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/gyro rename to src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/gyro diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/magnetic b/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/magnetic similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/magnetic rename to src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/magnetic diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/accel b/src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/accel similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/accel rename to src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/accel diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/gyro b/src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/gyro similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/gyro rename to src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/gyro diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/magnetic b/src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/magnetic similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/magnetic rename to src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/magnetic diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/accel b/src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/accel similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/accel rename to src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/accel diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/gyro b/src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/gyro similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/gyro rename to src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/gyro diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/magnetic b/src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/magnetic similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/magnetic rename to src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/magnetic diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/accel b/src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/accel similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/accel rename to src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/accel diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/gyro b/src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/gyro similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/gyro rename to src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/gyro diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/magnetic b/src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/magnetic similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/magnetic rename to src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/magnetic diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/accel b/src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/accel similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/accel rename to src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/accel diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/gyro b/src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/gyro similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/gyro rename to src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/gyro diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/magnetic b/src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/magnetic similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/magnetic rename to src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/magnetic diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/accel b/src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/accel similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/accel rename to src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/accel diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/gyro b/src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/gyro similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/gyro rename to src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/gyro diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/magnetic b/src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/magnetic similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/magnetic rename to src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/magnetic diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/accel b/src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/accel similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/accel rename to src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/accel diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/gyro b/src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/gyro similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/gyro rename to src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/gyro diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/magnetic b/src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/magnetic similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/magnetic rename to src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/magnetic diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/accel b/src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/accel similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/accel rename to src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/accel diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/gyro b/src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/gyro similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/gyro rename to src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/gyro diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/magnetic b/src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/magnetic similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/magnetic rename to src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/magnetic diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/accel b/src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/accel similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/accel rename to src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/accel diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/gyro b/src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/gyro similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/gyro rename to src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/gyro diff --git a/src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/magnetic b/src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/magnetic similarity index 100% rename from src/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/magnetic rename to src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/magnetic diff --git a/src/plugins/sensor_fusion/design/documentation/diagram/block_diagram_gravity_and_linear_acceleration.png b/src/server/sensor_fusion/design/documentation/diagram/block_diagram_gravity_and_linear_acceleration.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/diagram/block_diagram_gravity_and_linear_acceleration.png rename to src/server/sensor_fusion/design/documentation/diagram/block_diagram_gravity_and_linear_acceleration.png diff --git a/src/plugins/sensor_fusion/design/documentation/diagram/block_diagram_orientation_estimation.png b/src/server/sensor_fusion/design/documentation/diagram/block_diagram_orientation_estimation.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/diagram/block_diagram_orientation_estimation.png rename to src/server/sensor_fusion/design/documentation/diagram/block_diagram_orientation_estimation.png diff --git a/src/plugins/sensor_fusion/design/documentation/diagram/device_orientation.png b/src/server/sensor_fusion/design/documentation/diagram/device_orientation.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/diagram/device_orientation.png rename to src/server/sensor_fusion/design/documentation/diagram/device_orientation.png diff --git a/src/plugins/sensor_fusion/design/documentation/diagram/kalman_filter_stages.png b/src/server/sensor_fusion/design/documentation/diagram/kalman_filter_stages.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/diagram/kalman_filter_stages.png rename to src/server/sensor_fusion/design/documentation/diagram/kalman_filter_stages.png diff --git a/src/plugins/sensor_fusion/design/documentation/diagram/orientation_effect_on_gravity.png b/src/server/sensor_fusion/design/documentation/diagram/orientation_effect_on_gravity.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/diagram/orientation_effect_on_gravity.png rename to src/server/sensor_fusion/design/documentation/diagram/orientation_effect_on_gravity.png diff --git a/src/plugins/sensor_fusion/design/documentation/diagram/projection_diagram_gravity_computation.png b/src/server/sensor_fusion/design/documentation/diagram/projection_diagram_gravity_computation.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/diagram/projection_diagram_gravity_computation.png rename to src/server/sensor_fusion/design/documentation/diagram/projection_diagram_gravity_computation.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_1.png b/src/server/sensor_fusion/design/documentation/equation/equation_1.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_1.png rename to src/server/sensor_fusion/design/documentation/equation/equation_1.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_10.png b/src/server/sensor_fusion/design/documentation/equation/equation_10.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_10.png rename to src/server/sensor_fusion/design/documentation/equation/equation_10.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_11.png b/src/server/sensor_fusion/design/documentation/equation/equation_11.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_11.png rename to src/server/sensor_fusion/design/documentation/equation/equation_11.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_12.png b/src/server/sensor_fusion/design/documentation/equation/equation_12.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_12.png rename to src/server/sensor_fusion/design/documentation/equation/equation_12.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_13.png b/src/server/sensor_fusion/design/documentation/equation/equation_13.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_13.png rename to src/server/sensor_fusion/design/documentation/equation/equation_13.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_13_updated.png b/src/server/sensor_fusion/design/documentation/equation/equation_13_updated.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_13_updated.png rename to src/server/sensor_fusion/design/documentation/equation/equation_13_updated.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_14.png b/src/server/sensor_fusion/design/documentation/equation/equation_14.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_14.png rename to src/server/sensor_fusion/design/documentation/equation/equation_14.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_15.png b/src/server/sensor_fusion/design/documentation/equation/equation_15.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_15.png rename to src/server/sensor_fusion/design/documentation/equation/equation_15.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_16.png b/src/server/sensor_fusion/design/documentation/equation/equation_16.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_16.png rename to src/server/sensor_fusion/design/documentation/equation/equation_16.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_17.png b/src/server/sensor_fusion/design/documentation/equation/equation_17.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_17.png rename to src/server/sensor_fusion/design/documentation/equation/equation_17.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_18.png b/src/server/sensor_fusion/design/documentation/equation/equation_18.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_18.png rename to src/server/sensor_fusion/design/documentation/equation/equation_18.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_19.png b/src/server/sensor_fusion/design/documentation/equation/equation_19.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_19.png rename to src/server/sensor_fusion/design/documentation/equation/equation_19.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_2.png b/src/server/sensor_fusion/design/documentation/equation/equation_2.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_2.png rename to src/server/sensor_fusion/design/documentation/equation/equation_2.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_20.png b/src/server/sensor_fusion/design/documentation/equation/equation_20.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_20.png rename to src/server/sensor_fusion/design/documentation/equation/equation_20.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_21.png b/src/server/sensor_fusion/design/documentation/equation/equation_21.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_21.png rename to src/server/sensor_fusion/design/documentation/equation/equation_21.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_22.png b/src/server/sensor_fusion/design/documentation/equation/equation_22.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_22.png rename to src/server/sensor_fusion/design/documentation/equation/equation_22.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_23.png b/src/server/sensor_fusion/design/documentation/equation/equation_23.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_23.png rename to src/server/sensor_fusion/design/documentation/equation/equation_23.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_24.png b/src/server/sensor_fusion/design/documentation/equation/equation_24.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_24.png rename to src/server/sensor_fusion/design/documentation/equation/equation_24.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_25.png b/src/server/sensor_fusion/design/documentation/equation/equation_25.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_25.png rename to src/server/sensor_fusion/design/documentation/equation/equation_25.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_26.png b/src/server/sensor_fusion/design/documentation/equation/equation_26.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_26.png rename to src/server/sensor_fusion/design/documentation/equation/equation_26.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_27.png b/src/server/sensor_fusion/design/documentation/equation/equation_27.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_27.png rename to src/server/sensor_fusion/design/documentation/equation/equation_27.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_28.png b/src/server/sensor_fusion/design/documentation/equation/equation_28.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_28.png rename to src/server/sensor_fusion/design/documentation/equation/equation_28.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_29.png b/src/server/sensor_fusion/design/documentation/equation/equation_29.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_29.png rename to src/server/sensor_fusion/design/documentation/equation/equation_29.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_3.png b/src/server/sensor_fusion/design/documentation/equation/equation_3.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_3.png rename to src/server/sensor_fusion/design/documentation/equation/equation_3.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_30.png b/src/server/sensor_fusion/design/documentation/equation/equation_30.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_30.png rename to src/server/sensor_fusion/design/documentation/equation/equation_30.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_31.png b/src/server/sensor_fusion/design/documentation/equation/equation_31.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_31.png rename to src/server/sensor_fusion/design/documentation/equation/equation_31.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_32.png b/src/server/sensor_fusion/design/documentation/equation/equation_32.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_32.png rename to src/server/sensor_fusion/design/documentation/equation/equation_32.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_33.png b/src/server/sensor_fusion/design/documentation/equation/equation_33.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_33.png rename to src/server/sensor_fusion/design/documentation/equation/equation_33.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_34.png b/src/server/sensor_fusion/design/documentation/equation/equation_34.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_34.png rename to src/server/sensor_fusion/design/documentation/equation/equation_34.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_35.png b/src/server/sensor_fusion/design/documentation/equation/equation_35.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_35.png rename to src/server/sensor_fusion/design/documentation/equation/equation_35.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_36.png b/src/server/sensor_fusion/design/documentation/equation/equation_36.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_36.png rename to src/server/sensor_fusion/design/documentation/equation/equation_36.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_37.png b/src/server/sensor_fusion/design/documentation/equation/equation_37.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_37.png rename to src/server/sensor_fusion/design/documentation/equation/equation_37.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_38.png b/src/server/sensor_fusion/design/documentation/equation/equation_38.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_38.png rename to src/server/sensor_fusion/design/documentation/equation/equation_38.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_39.png b/src/server/sensor_fusion/design/documentation/equation/equation_39.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_39.png rename to src/server/sensor_fusion/design/documentation/equation/equation_39.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_4.png b/src/server/sensor_fusion/design/documentation/equation/equation_4.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_4.png rename to src/server/sensor_fusion/design/documentation/equation/equation_4.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_40.png b/src/server/sensor_fusion/design/documentation/equation/equation_40.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_40.png rename to src/server/sensor_fusion/design/documentation/equation/equation_40.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_5.png b/src/server/sensor_fusion/design/documentation/equation/equation_5.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_5.png rename to src/server/sensor_fusion/design/documentation/equation/equation_5.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_6.png b/src/server/sensor_fusion/design/documentation/equation/equation_6.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_6.png rename to src/server/sensor_fusion/design/documentation/equation/equation_6.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_7.png b/src/server/sensor_fusion/design/documentation/equation/equation_7.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_7.png rename to src/server/sensor_fusion/design/documentation/equation/equation_7.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_8.png b/src/server/sensor_fusion/design/documentation/equation/equation_8.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_8.png rename to src/server/sensor_fusion/design/documentation/equation/equation_8.png diff --git a/src/plugins/sensor_fusion/design/documentation/equation/equation_9.png b/src/server/sensor_fusion/design/documentation/equation/equation_9.png similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/equation/equation_9.png rename to src/server/sensor_fusion/design/documentation/equation/equation_9.png diff --git a/src/plugins/sensor_fusion/design/documentation/sensor_fusion.htm b/src/server/sensor_fusion/design/documentation/sensor_fusion.htm similarity index 100% rename from src/plugins/sensor_fusion/design/documentation/sensor_fusion.htm rename to src/server/sensor_fusion/design/documentation/sensor_fusion.htm diff --git a/src/plugins/sensor_fusion/design/lib/axis_rot2quat.m b/src/server/sensor_fusion/design/lib/axis_rot2quat.m similarity index 100% rename from src/plugins/sensor_fusion/design/lib/axis_rot2quat.m rename to src/server/sensor_fusion/design/lib/axis_rot2quat.m diff --git a/src/plugins/sensor_fusion/design/lib/estimate_gaming_rv.m b/src/server/sensor_fusion/design/lib/estimate_gaming_rv.m similarity index 100% rename from src/plugins/sensor_fusion/design/lib/estimate_gaming_rv.m rename to src/server/sensor_fusion/design/lib/estimate_gaming_rv.m diff --git a/src/plugins/sensor_fusion/design/lib/estimate_geomagnetic_rv.m b/src/server/sensor_fusion/design/lib/estimate_geomagnetic_rv.m similarity index 100% rename from src/plugins/sensor_fusion/design/lib/estimate_geomagnetic_rv.m rename to src/server/sensor_fusion/design/lib/estimate_geomagnetic_rv.m diff --git a/src/plugins/sensor_fusion/design/lib/estimate_gravity.m b/src/server/sensor_fusion/design/lib/estimate_gravity.m similarity index 100% rename from src/plugins/sensor_fusion/design/lib/estimate_gravity.m rename to src/server/sensor_fusion/design/lib/estimate_gravity.m diff --git a/src/plugins/sensor_fusion/design/lib/estimate_linear_acceleration.m b/src/server/sensor_fusion/design/lib/estimate_linear_acceleration.m similarity index 100% rename from src/plugins/sensor_fusion/design/lib/estimate_linear_acceleration.m rename to src/server/sensor_fusion/design/lib/estimate_linear_acceleration.m diff --git a/src/plugins/sensor_fusion/design/lib/estimate_orientation.m b/src/server/sensor_fusion/design/lib/estimate_orientation.m similarity index 100% rename from src/plugins/sensor_fusion/design/lib/estimate_orientation.m rename to src/server/sensor_fusion/design/lib/estimate_orientation.m diff --git a/src/plugins/sensor_fusion/design/lib/euler2quat.m b/src/server/sensor_fusion/design/lib/euler2quat.m similarity index 100% rename from src/plugins/sensor_fusion/design/lib/euler2quat.m rename to src/server/sensor_fusion/design/lib/euler2quat.m diff --git a/src/plugins/sensor_fusion/design/lib/quat2euler.m b/src/server/sensor_fusion/design/lib/quat2euler.m similarity index 100% rename from src/plugins/sensor_fusion/design/lib/quat2euler.m rename to src/server/sensor_fusion/design/lib/quat2euler.m diff --git a/src/plugins/sensor_fusion/design/lib/quat2rot_mat.m b/src/server/sensor_fusion/design/lib/quat2rot_mat.m similarity index 100% rename from src/plugins/sensor_fusion/design/lib/quat2rot_mat.m rename to src/server/sensor_fusion/design/lib/quat2rot_mat.m diff --git a/src/plugins/sensor_fusion/design/lib/quat_prod.m b/src/server/sensor_fusion/design/lib/quat_prod.m similarity index 100% rename from src/plugins/sensor_fusion/design/lib/quat_prod.m rename to src/server/sensor_fusion/design/lib/quat_prod.m diff --git a/src/plugins/sensor_fusion/design/lib/rot_mat2quat.m b/src/server/sensor_fusion/design/lib/rot_mat2quat.m similarity index 100% rename from src/plugins/sensor_fusion/design/lib/rot_mat2quat.m rename to src/server/sensor_fusion/design/lib/rot_mat2quat.m diff --git a/src/plugins/sensor_fusion/design/lib/sf_pedometer.m b/src/server/sensor_fusion/design/lib/sf_pedometer.m similarity index 100% rename from src/plugins/sensor_fusion/design/lib/sf_pedometer.m rename to src/server/sensor_fusion/design/lib/sf_pedometer.m diff --git a/src/plugins/sensor_fusion/design/readme b/src/server/sensor_fusion/design/readme similarity index 100% rename from src/plugins/sensor_fusion/design/readme rename to src/server/sensor_fusion/design/readme diff --git a/src/plugins/sensor_fusion/design/sf_gaming_rv.m b/src/server/sensor_fusion/design/sf_gaming_rv.m similarity index 100% rename from src/plugins/sensor_fusion/design/sf_gaming_rv.m rename to src/server/sensor_fusion/design/sf_gaming_rv.m diff --git a/src/plugins/sensor_fusion/design/sf_geomagnetic_rv.m b/src/server/sensor_fusion/design/sf_geomagnetic_rv.m similarity index 100% rename from src/plugins/sensor_fusion/design/sf_geomagnetic_rv.m rename to src/server/sensor_fusion/design/sf_geomagnetic_rv.m diff --git a/src/plugins/sensor_fusion/design/sf_gravity.m b/src/server/sensor_fusion/design/sf_gravity.m similarity index 100% rename from src/plugins/sensor_fusion/design/sf_gravity.m rename to src/server/sensor_fusion/design/sf_gravity.m diff --git a/src/plugins/sensor_fusion/design/sf_linear_acceleration.m b/src/server/sensor_fusion/design/sf_linear_acceleration.m similarity index 100% rename from src/plugins/sensor_fusion/design/sf_linear_acceleration.m rename to src/server/sensor_fusion/design/sf_linear_acceleration.m diff --git a/src/plugins/sensor_fusion/design/sf_orientation.m b/src/server/sensor_fusion/design/sf_orientation.m similarity index 100% rename from src/plugins/sensor_fusion/design/sf_orientation.m rename to src/server/sensor_fusion/design/sf_orientation.m diff --git a/src/plugins/sensor_fusion/euler_angles.cpp b/src/server/sensor_fusion/euler_angles.cpp similarity index 100% rename from src/plugins/sensor_fusion/euler_angles.cpp rename to src/server/sensor_fusion/euler_angles.cpp diff --git a/src/plugins/sensor_fusion/euler_angles.h b/src/server/sensor_fusion/euler_angles.h similarity index 100% rename from src/plugins/sensor_fusion/euler_angles.h rename to src/server/sensor_fusion/euler_angles.h diff --git a/src/plugins/sensor_fusion/matrix.cpp b/src/server/sensor_fusion/matrix.cpp similarity index 100% rename from src/plugins/sensor_fusion/matrix.cpp rename to src/server/sensor_fusion/matrix.cpp diff --git a/src/plugins/sensor_fusion/matrix.h b/src/server/sensor_fusion/matrix.h similarity index 100% rename from src/plugins/sensor_fusion/matrix.h rename to src/server/sensor_fusion/matrix.h diff --git a/src/plugins/sensor_fusion/orientation_filter.cpp b/src/server/sensor_fusion/orientation_filter.cpp similarity index 100% rename from src/plugins/sensor_fusion/orientation_filter.cpp rename to src/server/sensor_fusion/orientation_filter.cpp diff --git a/src/plugins/sensor_fusion/orientation_filter.h b/src/server/sensor_fusion/orientation_filter.h similarity index 100% rename from src/plugins/sensor_fusion/orientation_filter.h rename to src/server/sensor_fusion/orientation_filter.h diff --git a/src/plugins/sensor_fusion/quaternion.cpp b/src/server/sensor_fusion/quaternion.cpp similarity index 100% rename from src/plugins/sensor_fusion/quaternion.cpp rename to src/server/sensor_fusion/quaternion.cpp diff --git a/src/plugins/sensor_fusion/quaternion.h b/src/server/sensor_fusion/quaternion.h similarity index 100% rename from src/plugins/sensor_fusion/quaternion.h rename to src/server/sensor_fusion/quaternion.h diff --git a/src/plugins/sensor_fusion/rotation_matrix.cpp b/src/server/sensor_fusion/rotation_matrix.cpp similarity index 100% rename from src/plugins/sensor_fusion/rotation_matrix.cpp rename to src/server/sensor_fusion/rotation_matrix.cpp diff --git a/src/plugins/sensor_fusion/rotation_matrix.h b/src/server/sensor_fusion/rotation_matrix.h similarity index 100% rename from src/plugins/sensor_fusion/rotation_matrix.h rename to src/server/sensor_fusion/rotation_matrix.h diff --git a/src/plugins/sensor_fusion/sensor_data.cpp b/src/server/sensor_fusion/sensor_data.cpp similarity index 100% rename from src/plugins/sensor_fusion/sensor_data.cpp rename to src/server/sensor_fusion/sensor_data.cpp diff --git a/src/plugins/sensor_fusion/sensor_data.h b/src/server/sensor_fusion/sensor_data.h similarity index 100% rename from src/plugins/sensor_fusion/sensor_data.h rename to src/server/sensor_fusion/sensor_data.h diff --git a/src/plugins/sensor_fusion/test/gravity_sensor.cpp b/src/server/sensor_fusion/test/gravity_sensor.cpp similarity index 100% rename from src/plugins/sensor_fusion/test/gravity_sensor.cpp rename to src/server/sensor_fusion/test/gravity_sensor.cpp diff --git a/src/plugins/sensor_fusion/test/gravity_sensor.h b/src/server/sensor_fusion/test/gravity_sensor.h similarity index 100% rename from src/plugins/sensor_fusion/test/gravity_sensor.h rename to src/server/sensor_fusion/test/gravity_sensor.h diff --git a/src/plugins/sensor_fusion/test/linear_acceleration_sensor.cpp b/src/server/sensor_fusion/test/linear_acceleration_sensor.cpp similarity index 100% rename from src/plugins/sensor_fusion/test/linear_acceleration_sensor.cpp rename to src/server/sensor_fusion/test/linear_acceleration_sensor.cpp diff --git a/src/plugins/sensor_fusion/test/linear_acceleration_sensor.h b/src/server/sensor_fusion/test/linear_acceleration_sensor.h similarity index 100% rename from src/plugins/sensor_fusion/test/linear_acceleration_sensor.h rename to src/server/sensor_fusion/test/linear_acceleration_sensor.h diff --git a/src/plugins/sensor_fusion/test/orientation_sensor.cpp b/src/server/sensor_fusion/test/orientation_sensor.cpp similarity index 100% rename from src/plugins/sensor_fusion/test/orientation_sensor.cpp rename to src/server/sensor_fusion/test/orientation_sensor.cpp diff --git a/src/plugins/sensor_fusion/test/orientation_sensor.h b/src/server/sensor_fusion/test/orientation_sensor.h similarity index 100% rename from src/plugins/sensor_fusion/test/orientation_sensor.h rename to src/server/sensor_fusion/test/orientation_sensor.h diff --git a/src/plugins/sensor_fusion/test/test_projects/euler_angles_test/.cproject b/src/server/sensor_fusion/test/test_projects/euler_angles_test/.cproject similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/euler_angles_test/.cproject rename to src/server/sensor_fusion/test/test_projects/euler_angles_test/.cproject diff --git a/src/plugins/sensor_fusion/test/test_projects/euler_angles_test/.project b/src/server/sensor_fusion/test/test_projects/euler_angles_test/.project similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/euler_angles_test/.project rename to src/server/sensor_fusion/test/test_projects/euler_angles_test/.project diff --git a/src/plugins/sensor_fusion/test/test_projects/euler_angles_test/euler_angles_main.cpp b/src/server/sensor_fusion/test/test_projects/euler_angles_test/euler_angles_main.cpp similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/euler_angles_test/euler_angles_main.cpp rename to src/server/sensor_fusion/test/test_projects/euler_angles_test/euler_angles_main.cpp diff --git a/src/plugins/sensor_fusion/test/test_projects/gravity_sensor_test/.cproject b/src/server/sensor_fusion/test/test_projects/gravity_sensor_test/.cproject similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/gravity_sensor_test/.cproject rename to src/server/sensor_fusion/test/test_projects/gravity_sensor_test/.cproject diff --git a/src/plugins/sensor_fusion/test/test_projects/gravity_sensor_test/.project b/src/server/sensor_fusion/test/test_projects/gravity_sensor_test/.project similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/gravity_sensor_test/.project rename to src/server/sensor_fusion/test/test_projects/gravity_sensor_test/.project diff --git a/src/plugins/sensor_fusion/test/test_projects/gravity_sensor_test/gravity_sensor_main.cpp b/src/server/sensor_fusion/test/test_projects/gravity_sensor_test/gravity_sensor_main.cpp similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/gravity_sensor_test/gravity_sensor_main.cpp rename to src/server/sensor_fusion/test/test_projects/gravity_sensor_test/gravity_sensor_main.cpp diff --git a/src/plugins/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.cproject b/src/server/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.cproject similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.cproject rename to src/server/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.cproject diff --git a/src/plugins/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.project b/src/server/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.project similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.project rename to src/server/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.project diff --git a/src/plugins/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/linear_acceleration_sensor_main.cpp b/src/server/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/linear_acceleration_sensor_main.cpp similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/linear_acceleration_sensor_main.cpp rename to src/server/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/linear_acceleration_sensor_main.cpp diff --git a/src/plugins/sensor_fusion/test/test_projects/matrix_test/.cproject b/src/server/sensor_fusion/test/test_projects/matrix_test/.cproject similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/matrix_test/.cproject rename to src/server/sensor_fusion/test/test_projects/matrix_test/.cproject diff --git a/src/plugins/sensor_fusion/test/test_projects/matrix_test/.project b/src/server/sensor_fusion/test/test_projects/matrix_test/.project similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/matrix_test/.project rename to src/server/sensor_fusion/test/test_projects/matrix_test/.project diff --git a/src/plugins/sensor_fusion/test/test_projects/matrix_test/matrix_main.cpp b/src/server/sensor_fusion/test/test_projects/matrix_test/matrix_main.cpp similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/matrix_test/matrix_main.cpp rename to src/server/sensor_fusion/test/test_projects/matrix_test/matrix_main.cpp diff --git a/src/plugins/sensor_fusion/test/test_projects/orientation_sensor_test/.cproject b/src/server/sensor_fusion/test/test_projects/orientation_sensor_test/.cproject similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/orientation_sensor_test/.cproject rename to src/server/sensor_fusion/test/test_projects/orientation_sensor_test/.cproject diff --git a/src/plugins/sensor_fusion/test/test_projects/orientation_sensor_test/.project b/src/server/sensor_fusion/test/test_projects/orientation_sensor_test/.project similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/orientation_sensor_test/.project rename to src/server/sensor_fusion/test/test_projects/orientation_sensor_test/.project diff --git a/src/plugins/sensor_fusion/test/test_projects/orientation_sensor_test/orientation_sensor_main.cpp b/src/server/sensor_fusion/test/test_projects/orientation_sensor_test/orientation_sensor_main.cpp similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/orientation_sensor_test/orientation_sensor_main.cpp rename to src/server/sensor_fusion/test/test_projects/orientation_sensor_test/orientation_sensor_main.cpp diff --git a/src/plugins/sensor_fusion/test/test_projects/quaternion_test/.cproject b/src/server/sensor_fusion/test/test_projects/quaternion_test/.cproject similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/quaternion_test/.cproject rename to src/server/sensor_fusion/test/test_projects/quaternion_test/.cproject diff --git a/src/plugins/sensor_fusion/test/test_projects/quaternion_test/.project b/src/server/sensor_fusion/test/test_projects/quaternion_test/.project similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/quaternion_test/.project rename to src/server/sensor_fusion/test/test_projects/quaternion_test/.project diff --git a/src/plugins/sensor_fusion/test/test_projects/quaternion_test/quaternion_main.cpp b/src/server/sensor_fusion/test/test_projects/quaternion_test/quaternion_main.cpp similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/quaternion_test/quaternion_main.cpp rename to src/server/sensor_fusion/test/test_projects/quaternion_test/quaternion_main.cpp diff --git a/src/plugins/sensor_fusion/test/test_projects/rotation_matrix_test/.cproject b/src/server/sensor_fusion/test/test_projects/rotation_matrix_test/.cproject similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/rotation_matrix_test/.cproject rename to src/server/sensor_fusion/test/test_projects/rotation_matrix_test/.cproject diff --git a/src/plugins/sensor_fusion/test/test_projects/rotation_matrix_test/.project b/src/server/sensor_fusion/test/test_projects/rotation_matrix_test/.project similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/rotation_matrix_test/.project rename to src/server/sensor_fusion/test/test_projects/rotation_matrix_test/.project diff --git a/src/plugins/sensor_fusion/test/test_projects/rotation_matrix_test/rotation_matrix_main.cpp b/src/server/sensor_fusion/test/test_projects/rotation_matrix_test/rotation_matrix_main.cpp similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/rotation_matrix_test/rotation_matrix_main.cpp rename to src/server/sensor_fusion/test/test_projects/rotation_matrix_test/rotation_matrix_main.cpp diff --git a/src/plugins/sensor_fusion/test/test_projects/sensor_data_test/.cproject b/src/server/sensor_fusion/test/test_projects/sensor_data_test/.cproject similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/sensor_data_test/.cproject rename to src/server/sensor_fusion/test/test_projects/sensor_data_test/.cproject diff --git a/src/plugins/sensor_fusion/test/test_projects/sensor_data_test/.project b/src/server/sensor_fusion/test/test_projects/sensor_data_test/.project similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/sensor_data_test/.project rename to src/server/sensor_fusion/test/test_projects/sensor_data_test/.project diff --git a/src/plugins/sensor_fusion/test/test_projects/sensor_data_test/sensor_data_main.cpp b/src/server/sensor_fusion/test/test_projects/sensor_data_test/sensor_data_main.cpp similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/sensor_data_test/sensor_data_main.cpp rename to src/server/sensor_fusion/test/test_projects/sensor_data_test/sensor_data_main.cpp diff --git a/src/plugins/sensor_fusion/test/test_projects/vector_test/.cproject b/src/server/sensor_fusion/test/test_projects/vector_test/.cproject similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/vector_test/.cproject rename to src/server/sensor_fusion/test/test_projects/vector_test/.cproject diff --git a/src/plugins/sensor_fusion/test/test_projects/vector_test/.project b/src/server/sensor_fusion/test/test_projects/vector_test/.project similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/vector_test/.project rename to src/server/sensor_fusion/test/test_projects/vector_test/.project diff --git a/src/plugins/sensor_fusion/test/test_projects/vector_test/vector_main.cpp b/src/server/sensor_fusion/test/test_projects/vector_test/vector_main.cpp similarity index 100% rename from src/plugins/sensor_fusion/test/test_projects/vector_test/vector_main.cpp rename to src/server/sensor_fusion/test/test_projects/vector_test/vector_main.cpp diff --git a/src/plugins/sensor_fusion/vector.cpp b/src/server/sensor_fusion/vector.cpp similarity index 100% rename from src/plugins/sensor_fusion/vector.cpp rename to src/server/sensor_fusion/vector.cpp diff --git a/src/plugins/sensor_fusion/vector.h b/src/server/sensor_fusion/vector.h similarity index 100% rename from src/plugins/sensor_fusion/vector.h rename to src/server/sensor_fusion/vector.h diff --git a/src/shared/sensord-server.pc.in b/src/server/sensord-server.pc.in similarity index 100% rename from src/shared/sensord-server.pc.in rename to src/server/sensord-server.pc.in diff --git a/src/shared/virtual_sensor.cpp b/src/server/virtual_sensor.cpp similarity index 100% rename from src/shared/virtual_sensor.cpp rename to src/server/virtual_sensor.cpp diff --git a/src/shared/virtual_sensor.h b/src/server/virtual_sensor.h similarity index 100% rename from src/shared/virtual_sensor.h rename to src/server/virtual_sensor.h diff --git a/src/shared/worker_thread.cpp b/src/server/worker_thread.cpp similarity index 100% rename from src/shared/worker_thread.cpp rename to src/server/worker_thread.cpp diff --git a/src/shared/worker_thread.h b/src/server/worker_thread.h similarity index 100% rename from src/shared/worker_thread.h rename to src/server/worker_thread.h diff --git a/src/shared/csensor_config.cpp b/src/shared/csensor_config.cpp deleted file mode 100755 index f36c818..0000000 --- a/src/shared/csensor_config.cpp +++ /dev/null @@ -1,279 +0,0 @@ -/* - * libsensord-share - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include -#include "common.h" -#include -#include -#include -#include -#include -#include - -using std::ifstream; -using std::string; -using std::istringstream; - -#define ROOT_ELEMENT "SENSOR" -#define TEXT_ELEMENT "text" -#define MODEL_ID_ATTR "id" -#define DEFAULT_ATTR "value" - -csensor_config::csensor_config() -{ -} - -csensor_config& csensor_config::get_instance(void) -{ - static bool load_done = false; - static csensor_config inst; - - if (!load_done) { - inst.load_config(SENSOR_CONFIG_FILE_PATH); - inst.get_device_id(); - if (!inst.m_device_id.empty()) - INFO("Device ID = %s", inst.m_device_id.c_str()); - else - ERR("Failed to get Device ID"); - load_done = true; - } - - return inst; -} - -bool csensor_config::load_config(const string& config_path) -{ - xmlDocPtr doc; - xmlNodePtr cur; - - DBG("csensor_config::load_config(\"%s\") is called!\n",config_path.c_str()); - - doc = xmlParseFile(config_path.c_str()); - - if (doc == NULL) { - ERR("There is no %s\n",config_path.c_str()); - return false; - } - - cur = xmlDocGetRootElement(doc); - if(cur == NULL) { - ERR("There is no root element in %s\n",config_path.c_str()); - xmlFreeDoc(doc); - return false; - } - - if(xmlStrcmp(cur->name, (const xmlChar *)ROOT_ELEMENT)) { - ERR("Wrong type document: there is no [%s] root element in %s\n",ROOT_ELEMENT,config_path.c_str()); - xmlFreeDoc(doc); - return false; - } - - xmlNodePtr model_list_node_ptr; - xmlNodePtr model_node_ptr; - xmlNodePtr element_node_ptr; - xmlAttrPtr attr_ptr; - char* prop = NULL; - - model_list_node_ptr = cur->xmlChildrenNode; - - while (model_list_node_ptr != NULL) { - //skip garbage element, [text] - if (!xmlStrcmp(model_list_node_ptr->name,(const xmlChar *)TEXT_ELEMENT)) { - model_list_node_ptr = model_list_node_ptr->next; - continue; - } - - //insert Model_list to config map - m_sensor_config[(const char*)model_list_node_ptr->name]; - DBG("<%s>\n",(const char*)model_list_node_ptr->name); - - model_node_ptr = model_list_node_ptr->xmlChildrenNode; - while (model_node_ptr != NULL){ - //skip garbage element, [text] - if (!xmlStrcmp(model_node_ptr->name,(const xmlChar *)TEXT_ELEMENT)) { - model_node_ptr = model_node_ptr->next; - continue; - } - - - string model_id; - prop = (char*)xmlGetProp(model_node_ptr,(const xmlChar*)MODEL_ID_ATTR); - model_id = prop; - free(prop); - - //insert Model to Model_list - m_sensor_config[(const char*)model_list_node_ptr->name][model_id]; - DBG("<%s id=\"%s\">\n",(const char*)model_list_node_ptr->name,model_id.c_str()); - - element_node_ptr = model_node_ptr->xmlChildrenNode; - while (element_node_ptr != NULL) { - //skip garbage element, [text] - if (!xmlStrcmp(element_node_ptr->name,(const xmlChar *)TEXT_ELEMENT)) { - element_node_ptr = element_node_ptr->next; - continue; - } - - //insert Element to Model - m_sensor_config[(const char*)model_list_node_ptr->name][model_id][(const char*)element_node_ptr->name]; - DBG("<%s id=\"%s\"><%s>\n",(const char*)model_list_node_ptr->name,model_id.c_str(),(const char*)element_node_ptr->name); - - attr_ptr = element_node_ptr->properties; - while (attr_ptr != NULL) { - - string key,value; - key = (char*)attr_ptr->name; - prop = (char*)xmlGetProp(element_node_ptr,attr_ptr->name); - value = prop; - free(prop); - - //insert attribute to Element - m_sensor_config[(const char*)model_list_node_ptr->name][model_id][(const char*)element_node_ptr->name][key]=value; - DBG("<%s id=\"%s\"><%s \"%s\"=\"%s\">\n",(const char*)model_list_node_ptr->name,model_id.c_str(),(const char*)element_node_ptr->name,key.c_str(),value.c_str()); - attr_ptr = attr_ptr->next; - } - - - element_node_ptr = element_node_ptr->next; - } - - DBG("\n"); - model_node_ptr = model_node_ptr->next; - } - - DBG("\n"); - model_list_node_ptr = model_list_node_ptr->next; - } - - xmlFreeDoc(doc); - return true; -} - - -bool csensor_config::get(const string& sensor_type,const string& model_id, const string& element, const string& attr, string& value) -{ - auto it_model_list = m_sensor_config.find(sensor_type); - - if (it_model_list == m_sensor_config.end()) { - ERR("There is no <%s> element\n",sensor_type.c_str()); - return false; - } - - auto it_model = it_model_list->second.find(model_id); - - if (it_model == it_model_list->second.end()) { - ERR("There is no <%s id=\"%s\"> element\n",sensor_type.c_str(),model_id.c_str()); - return false; - } - - auto it_element = it_model->second.find(element); - - if (it_element == it_model->second.end()) { - DBG("There is no <%s id=\"%s\"><%s> element\n",sensor_type.c_str(),model_id.c_str(),element.c_str()); - return false; - } - - auto it_attr = it_element->second.find(attr); - - if (it_attr == it_element->second.end()) { - DBG("There is no <%s id=\"%s\"><%s \"%s\">\n",sensor_type.c_str(),model_id.c_str(),element.c_str(),attr.c_str()); - return false; - } - - value = it_attr->second; - - return true; -} - -bool csensor_config::get(const string& sensor_type, const string& model_id, const string& element, const string& attr, double& value) -{ - string str_value; - - if (get(sensor_type,model_id,element,attr,str_value) == false) - return false; - - istringstream convert(str_value); - - if ( !(convert >> value)) - value = 0; - - return true; -} - -bool csensor_config::get(const string& sensor_type, const string& model_id, const string& element, const string& attr, long& value) -{ - string str_value; - - if (get(sensor_type,model_id,element,attr,str_value) == false) - return false; - - istringstream convert(str_value); - - if ( !(convert >> value)) - value = 0; - - return true; -} - -bool csensor_config::get(const string& sensor_type, const string& model_id, const string& element, string& value) -{ - if (get(sensor_type, model_id, element, m_device_id, value)) - return true; - - if (get(sensor_type, model_id, element, DEFAULT_ATTR, value)) - return true; - - return false; -} - -bool csensor_config::get(const string& sensor_type, const string& model_id, const string& element, double& value) -{ - if (get(sensor_type, model_id, element, m_device_id, value)) - return true; - - if (get(sensor_type, model_id, element, DEFAULT_ATTR, value)) - return true; - - return false; -} - -bool csensor_config::get(const string& sensor_type, const string& model_id, const string& element, long& value) -{ - if (get(sensor_type, model_id, element, m_device_id, value)) - return true; - - if (get(sensor_type, model_id, element, DEFAULT_ATTR, value)) - return true; - - return false; -} - -bool csensor_config::is_supported(const string& sensor_type,const string& model_id) -{ - auto it_model_list = m_sensor_config.find(sensor_type); - - if (it_model_list == m_sensor_config.end()) - return false; - - auto it_model = it_model_list->second.find(model_id); - - if (it_model == it_model_list->second.end()) - return false; - - return true; -} diff --git a/src/shared/csensor_config.h b/src/shared/csensor_config.h deleted file mode 100755 index 5ce6c74..0000000 --- a/src/shared/csensor_config.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * libsensord-share - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#if !defined(_CSENSOR_CONFIG_CLASS_H_) -#define _CSENSOR_CONFIG_CLASS_H_ - -#include - -#define SENSOR_CONFIG_FILE_PATH "/usr/etc/sensors.xml" - -typedef std::unordered_map Element; -/* -* an Element is a group of attributes -* -* -* "value" -> "LSM330DLC" -* -*/ - -typedef std::unordered_map Model; -/* -* a Model is a group of elements to consist of specific vendor's one sensor configuration -* -* -* -* -* -* -> -* -*/ - -typedef std::unordered_map Model_list; -/* -* a Model_list is a group of Model -* -* -* -* -* -* "lsm330dlc_accel" -> -* -*/ - -typedef std::unordered_map Sensor_config; -/* -* a SensorConfig represents sensors.xml -* -* -* -* -* "ACCEL" -> Model_list -* -*/ - -class csensor_config : public cconfig -{ -private: - csensor_config(); - csensor_config(csensor_config const&) {}; - csensor_config& operator=(csensor_config const&); - - bool load_config(const std::string& config_path); - - Sensor_config m_sensor_config; -public: - static csensor_config& get_instance(void); - - bool get(const std::string& sensor_type, const std::string& model_id, const std::string& element, const std::string& attr, std::string& value); - bool get(const std::string& sensor_type, const std::string& model_id, const std::string& element, const std::string& attr, double& value); - bool get(const std::string& sensor_type, const std::string& model_id, const std::string& element, const std::string& attr, long& value); - - bool get(const std::string& sensor_type, const std::string& model_id, const std::string& element, std::string& value); - bool get(const std::string& sensor_type, const std::string& model_id, const std::string& element, double& value); - bool get(const std::string& sensor_type, const std::string& model_id, const std::string& element, long& value); - - bool is_supported(const std::string &sensor_type, const std::string &model_id); -}; - -#endif diff --git a/src/shared/iio_common.cpp b/src/shared/iio_common.cpp deleted file mode 100755 index 7cfcba5..0000000 --- a/src/shared/iio_common.cpp +++ /dev/null @@ -1,208 +0,0 @@ -/* - * sensord - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include -#include -#include -#include -#include -#include - -#define SCAN_EL_DIR "scan_elements/" - -#define BYTE_SIZE 8 -#define ULONGLONG 64 - -using std::fstream; -using std::ifstream; -using std::string; -using std::ios; - -void sort_channels_by_index(struct channel_parameters *channels, int count) -{ - struct channel_parameters temp; - int i, j; - - for (i = 0; i < count; i++) - for (j = i; (j > 0) && (channels[j].index < channels[j-1].index); j--) - { - temp = channels[j]; - channels[j] = channels[j-1]; - channels[j-1] = temp; - } -} - -int decode_channel_data_type(const char *device_dir, const char *ch_name, struct channel_parameters *ch_info) -{ - string file_type, type_string; - ifstream ftype; - char s_char, e_char; - unsigned bit_count, pad_bit_count, shift_count; - - file_type = string(device_dir) + string(SCAN_EL_DIR) + string(ch_name) + string("_type"); - ftype.open(file_type.c_str()); - if (!ftype.is_open()) - return -1; - ftype >> type_string; - sscanf(type_string.c_str(), "%ce:%c%u/%u>>%u", &e_char, - &s_char, &bit_count, &pad_bit_count, &shift_count); - if (e_char == 'b') - ch_info->big_endian = 1; - else - ch_info->big_endian = 0; - - if (s_char == 's') - ch_info->is_signed = 1; - else - ch_info->is_signed = 0; - - ch_info->valid_bits = bit_count; - ch_info->byte_count = pad_bit_count / BYTE_SIZE; - - if (bit_count == ULONGLONG) - ch_info->mask = ~0; - else - ch_info->mask = (1 << bit_count) - 1; - ch_info->shift = shift_count; - return 0; -} - -int add_channel_to_array(const char *device_dir, const char *ch_name, struct channel_parameters *channel) -{ - string file_en, file_type, file_index, file_scale, file_offset; - ifstream ftemp; - unsigned int i; - - file_en = string(device_dir) + string(SCAN_EL_DIR) + string(ch_name) + string("_en"); - file_index = string(device_dir) + string(SCAN_EL_DIR) + string(ch_name) + string("_index"); - file_scale = string(device_dir) + string(ch_name) + string("_scale"); - file_offset = string(device_dir) + string(ch_name) + string("_offset"); - - ftemp.open(file_en.c_str()); - if (!ftemp.is_open()) - return -1; - - ftemp >> i; - ftemp.close(); - if (i == 0) - return -1; - - if (asprintf(&(channel->prefix_str), "%s", ch_name) == -1) - return -1; - - channel->is_en = 1; - channel->scale = 1.0; - channel->offset = 0.0; - - ftemp.open(file_index.c_str()); - if (!ftemp.is_open()) - return -1; - ftemp >> i; - channel->index = i; - ftemp.close(); - - ftemp.open(file_scale.c_str()); - if (ftemp.is_open()) - { - ftemp >> channel->scale; - ftemp.close(); - } - - ftemp.open(file_offset.c_str()); - if (ftemp.is_open()) - { - ftemp >> channel->offset; - ftemp.close(); - } - decode_channel_data_type(device_dir, ch_name, channel); - return 0; -} - -int get_channel_array_size(struct channel_parameters *channels, int num_channels) -{ - int bytes = 0; - int i = 0; - while (i < num_channels) { - if (bytes % channels[i].byte_count == 0) - channels[i].buf_index = bytes; - else - channels[i].buf_index = bytes - bytes % channels[i].byte_count - + channels[i].byte_count; - bytes = channels[i].buf_index + channels[i].byte_count; - i++; - } - return bytes; -} - -int update_sysfs_num(const char *filepath, int val, bool verify) -{ - fstream sysfile; - sysfile.open(filepath); - if (!sysfile.is_open()) - return -1; - sysfile << val; - if (verify) - { - int test; - sysfile.seekp(0, ios::beg); - sysfile >> test; - if (test != val) - return -1; - } - return 0; -} - -int update_sysfs_string(const char *filepath, const char *val) -{ - fstream sysfile; - sysfile.open(filepath); - if (!sysfile.is_open()) { - ERR("File Open Error, %s", filepath); - return -1; - } - sysfile << val; - return 0; -} - -int convert_bytes_to_int(int input, struct channel_parameters *info) -{ - int retVal; - - if (info->big_endian) - input = be16toh((unsigned short int) input); - else - input = le16toh((unsigned short int) input); - - input = input >> info->shift; - if (info->is_signed) - { - short int val = input; - val &= (1 << info->valid_bits) - 1; - val = (short int)(val << (16 - info->valid_bits)) >> - (16 - info->valid_bits); - retVal = val; - } - else - { - unsigned short int val = input; - val &= (1 << info->valid_bits) - 1; - retVal = val; - } - return retVal; -} diff --git a/src/shared/iio_common.h b/src/shared/iio_common.h deleted file mode 100755 index 80f1f34..0000000 --- a/src/shared/iio_common.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * sensord - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef IIO_COMMON_H_ -#define IIO_COMMON_H_ - -#include -#include -#include -#include - -#define NO_OF_ULL_BYTES 8 -#define NO_OF_SHORT_VAL 4 -#define CH0_INDEX 0 -#define CH1_INDEX 1 - -#define GET_DIFF_BIT(val) (((unsigned short)(val) >> 7) & 0x01) -#define GET_DIR_VAL(val) ((val) & 0x0F) - -#define IOCTL_IIO_EVENT_FD _IOR('i', 0x90, int) - -struct channel_parameters -{ - char *prefix_str; - float scale; - float offset; - unsigned int index; - unsigned int byte_count; - unsigned int valid_bits; - unsigned int shift; - unsigned long long int mask; - unsigned int big_endian; - unsigned int is_signed; - unsigned int is_en; - unsigned int buf_index; -}; - -typedef struct iio_event_struct -{ - unsigned long long int event_id; - long long int timestamp; -} iio_event_t; - -typedef enum event_id_field -{ - CH_TYPE = 4, - MODIFIER, - DIRECTION, - EVENT_TYPE, -} event_id_field_t; - -typedef union ull_bytes -{ - unsigned long long num; - short int channels[NO_OF_SHORT_VAL]; - unsigned char bytes[NO_OF_ULL_BYTES]; -} ull_bytes_t; - -void sort_channels_by_index(struct channel_parameters *channels, int count); -int decode_channel_data_type(const char *device_dir, const char *ch_name, struct channel_parameters *ch_info); -int add_channel_to_array(const char *device_dir, const char *ch_name, struct channel_parameters *channel); -int get_channel_array_size(struct channel_parameters *channels, int num_channels); -int update_sysfs_num(const char *filepath, int val, bool verify = false); -int update_sysfs_string(const char *filepath, const char *val); -int convert_bytes_to_int(int input, struct channel_parameters *info); - -template -bool read_node_value(std::string node_path, value_t &value) -{ - std::ifstream handle; - handle.open(node_path.c_str()); - if (!handle) - { - ERR("Failed to open handle(%s)", node_path.c_str()); - return false; - } - handle >> value; - handle.close(); - - return true; -} - -#endif /* IIO_COMMON_H_ */ diff --git a/src/shared/sensor_accel.h b/src/shared/sensor_accel.h deleted file mode 100755 index ed98ff1..0000000 --- a/src/shared/sensor_accel.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * libsensord - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __SENSOR_ACCEL_H__ -#define __SENSOR_ACCEL_H__ - -//! Pre-defined events for the accelometer sensor -//! Sensor Plugin developer can add more event to their own headers - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @defgroup SENSOR_ACCEL Accelerometer Sensor - * @ingroup SENSOR_FRAMEWORK - * - * These APIs are used to control the Accelerometer sensor. - * @{ - */ - -enum accelerometer_event_type { - ACCELEROMETER_RAW_DATA_EVENT = (ACCELEROMETER_SENSOR << 16) | 0x0001, - ACCELEROMETER_UNPROCESSED_DATA_EVENT = (ACCELEROMETER_SENSOR << 16) | 0x0002, -}; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif -//! End of a file diff --git a/src/shared/sensor_auto_rotation.h b/src/shared/sensor_auto_rotation.h deleted file mode 100755 index 1f717c5..0000000 --- a/src/shared/sensor_auto_rotation.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * libsensord - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef _SENSOR_AUTO_ROTATION_H_ -#define _SENSOR_AUTO_ROTATION_H_ - -//! Pre-defined events for the auto_rotation sensor -//! Sensor Plugin developer can add more event to their own headers - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @defgroup SENSOR_AUTO_ROTATION Auto Rotation Sensor - * @ingroup SENSOR_FRAMEWORK - * - * These APIs are used to control the Auto Rotation sensor. - * @{ - */ - -enum auto_rotation_event_type { - AUTO_ROTATION_CHANGE_STATE_EVENT = (AUTO_ROTATION_SENSOR << 16) | 0x0001, -}; - -enum auto_rotation_state { - AUTO_ROTATION_DEGREE_UNKNOWN = 0, - AUTO_ROTATION_DEGREE_0, - AUTO_ROTATION_DEGREE_90, - AUTO_ROTATION_DEGREE_180, - AUTO_ROTATION_DEGREE_270, -}; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif -//! End of a file diff --git a/src/shared/sensor_bio_led_red.h b/src/shared/sensor_bio_led_red.h deleted file mode 100644 index 4720f2c..0000000 --- a/src/shared/sensor_bio_led_red.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * libsensord - * - * Copyright (c) 2015 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __SENSOR_BIO_LED_RED_H__ -#define __SENSOR_BIO_LED_RED_H__ - -//! Pre-defined events for the bio led red sensor -//! Sensor Plugin developer can add more event to their own headers - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @defgroup SENSOR_BIO_LED_RED HRM LED RED Sensor - * @ingroup SENSOR_FRAMEWORK - * - * These APIs are used to control the HRM LED RED sensor. - * @{ - */ - -enum bio_led_green_event_type { - BIO_LED_RED_RAW_DATA_EVENT = (BIO_LED_RED_SENSOR << 16) | 0x0001, -}; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif -//! End of a file diff --git a/src/shared/sensor_context.h b/src/shared/sensor_context.h deleted file mode 100755 index d35f941..0000000 --- a/src/shared/sensor_context.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * libsensord - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __SENSOR_CONTEXT_H__ -#define __SENSOR_CONTEXT_H__ - -//! Pre-defined events for the context sensor -//! Sensor Plugin developer can add more event to their own headers - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @defgroup SENSOR_CONTEXT Context Sensor - * @ingroup SENSOR_FRAMEWORK - * - * These APIs are used to control the Context sensor. - * @{ - */ - -enum context_event_type { - CONTEXT_REPORT_EVENT = (CONTEXT_SENSOR << 16) | 0x0001, -}; - -enum context_property_id { - CONTEXT_PROPERTY_UNKNOWN = 0, -}; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif -//! End of a file diff --git a/src/shared/sensor_fusion.h b/src/shared/sensor_fusion.h deleted file mode 100755 index 1a65ea3..0000000 --- a/src/shared/sensor_fusion.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * libsensord - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __SENSOR_FUSION_H__ -#define __SENSOR_FUSION_H__ - -//! Pre-defined events for the fusion sensor -//! Sensor Plugin developer can add more event to their own headers - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @defgroup SENSOR_FUSION Fusion Sensor - * @ingroup SENSOR_FRAMEWORK - * - * These APIs are used to control the Fusion sensor. - * @{ - */ -enum fusion_event_type { - FUSION_EVENT = (FUSION_SENSOR << 16) | 0x0001, - FUSION_UNCAL_GYRO_EVENT = (FUSION_SENSOR << 16) | 0x0002, - FUSION_CALIBRATION_NEEDED_EVENT = (FUSION_SENSOR << 16) | 0x0003, - FUSION_ORIENTATION_ENABLED = (FUSION_SENSOR << 16) | 0x0004, - FUSION_ROTATION_VECTOR_ENABLED = (FUSION_SENSOR << 16) | 0x0005, - FUSION_GAMING_ROTATION_VECTOR_ENABLED = (FUSION_SENSOR << 16) | 0x0006, - FUSION_GEOMAGNETIC_ROTATION_VECTOR_ENABLED = (FUSION_SENSOR << 16) | 0x0007, - FUSION_TILT_ENABLED = (FUSION_SENSOR << 16) | 0x0008, - FUSION_UNCAL_GYRO_ENABLED = (FUSION_SENSOR << 16) | 0x0009, -}; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif -//! End of a file diff --git a/src/shared/sensor_gaming_rv.h b/src/shared/sensor_gaming_rv.h deleted file mode 100755 index a02f738..0000000 --- a/src/shared/sensor_gaming_rv.h +++ /dev/null @@ -1,35 +0,0 @@ - -#ifndef __SENSOR_GAMING_RV_H__ -#define __SENSOR_GAMING_RV_H__ - -//! Pre-defined events for the gaming rotation vector sensor -//! Sensor Plugin developer can add more event to their own headers - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @defgroup SENSOR_GAMING_RV Gaming Rotation Vector Sensor - * @ingroup SENSOR_FRAMEWORK - * - * These APIs are used to control the Gaming Rotation Vector sensor. - * @{ - */ - -enum gaming_rv_event_type { - GAMING_RV_RAW_DATA_EVENT = (GAMING_RV_SENSOR << 16) | 0x0001, -}; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif -//! End of a file - diff --git a/src/shared/sensor_geomag.h b/src/shared/sensor_geomag.h deleted file mode 100755 index 7680ac2..0000000 --- a/src/shared/sensor_geomag.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * libsensord - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __SENSOR_GEOMAG_H__ -#define __SENSOR_GEOMAG_H__ - -//! Pre-defined events for the geomagnetic sensor -//! Sensor Plugin developer can add more event to their own headers - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @defgroup SENSOR_GEOMAG Geomagnetic Sensor - * @ingroup SENSOR_FRAMEWORK - * - * These APIs are used to control the Geomagnatic sensor. - * @{ - */ - -enum geomag_event_type { - GEOMAGNETIC_RAW_DATA_EVENT = (GEOMAGNETIC_SENSOR << 16) | 0x0001, - GEOMAGNETIC_CALIBRATION_NEEDED_EVENT = (GEOMAGNETIC_SENSOR << 16) | 0x0002, - GEOMAGNETIC_UNPROCESSED_DATA_EVENT = (GEOMAGNETIC_SENSOR << 16) | 0x0003, -}; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif -//! End of a file diff --git a/src/shared/sensor_geomagnetic_rv.h b/src/shared/sensor_geomagnetic_rv.h deleted file mode 100755 index c0fc830..0000000 --- a/src/shared/sensor_geomagnetic_rv.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * libsensord - * - * Copyright (c) 2015 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __SENSOR_GEOMAGNETIC_RV_H__ -#define __SENSOR_GEOMAGNETIC_RV_H__ - -//! Pre-defined events for the geomagnetic rotation vector sensor -//! Sensor Plugin developer can add more event to their own headers - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @defgroup SENSOR_GEOMAGNETIC_RV Geomagnetic Rotation Vector Sensor - * @ingroup SENSOR_FRAMEWORK - * - * These APIs are used to control the Geomagnetic Rotation Vector sensor. - * @{ - */ - -enum geomagnetic_rv_event_type { - GEOMAGNETIC_RV_RAW_DATA_EVENT = (GEOMAGNETIC_RV_SENSOR << 16) | 0x0001, -}; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __SENSOR_GEOMAGNETIC_RV_H__ */ diff --git a/src/shared/sensor_gravity.h b/src/shared/sensor_gravity.h deleted file mode 100755 index de48faa..0000000 --- a/src/shared/sensor_gravity.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * libsensord - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __SENSOR_GRAVITY_H__ -#define __SENSOR_GRAVITY_H__ - -//! Pre-defined events for the gravity sensor -//! Sensor Plugin developer can add more event to their own headers - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @defgroup SENSOR_GRAVITY Gravity Sensor - * @ingroup SENSOR_FRAMEWORK - * - * These APIs are used to control the Gravity sensor. - * @{ - */ - -enum gravity_event_type { - GRAVITY_RAW_DATA_EVENT = (GRAVITY_SENSOR << 16) | 0x0001, -}; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif -//! End of a file diff --git a/src/shared/sensor_gyro.h b/src/shared/sensor_gyro.h deleted file mode 100755 index 0425afe..0000000 --- a/src/shared/sensor_gyro.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * libsensord - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __SENSOR_GYRO_H__ -#define __SENSOR_GYRO_H__ - -//! Pre-defined events for the gyroscope sensor -//! Sensor Plugin developer can add more event to their own headers - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @defgroup SENSOR_GYRO Gyro Sensor - * @ingroup SENSOR_FRAMEWORK - * - * These APIs are used to control the gyro sensor. - * @{ - */ - -enum gyro_event_type { - GYROSCOPE_RAW_DATA_EVENT = (GYROSCOPE_SENSOR << 16) | 0x0001, - GYROSCOPE_UNPROCESSED_DATA_EVENT = (GYROSCOPE_SENSOR << 16) | 0x0002, -}; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif -//! End of a file diff --git a/src/shared/sensor_internal.h b/src/shared/sensor_internal.h index b02ba89..a4395f4 100644 --- a/src/shared/sensor_internal.h +++ b/src/shared/sensor_internal.h @@ -43,26 +43,7 @@ extern "C" #include /*header for each sensor type*/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include typedef void (*sensor_cb_t)(sensor_t sensor, unsigned int event_type, sensor_data_t *data, void *user_data); typedef void (*sensorhub_cb_t)(sensor_t sensor, unsigned int event_type, sensorhub_data_t *data, void *user_data); diff --git a/src/shared/sensor_internal_deprecated.h b/src/shared/sensor_internal_deprecated.h index b42c045..38665f7 100755 --- a/src/shared/sensor_internal_deprecated.h +++ b/src/shared/sensor_internal_deprecated.h @@ -37,28 +37,7 @@ extern "C" #include /*header for each sensor type*/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #define MAX_KEY_LEN 30 diff --git a/src/shared/sensor_light.h b/src/shared/sensor_light.h deleted file mode 100755 index 1f476b6..0000000 --- a/src/shared/sensor_light.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * libsensord - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __SENSOR_LIGHT_H__ -#define __SENSOR_LIGHT_H__ - -//! Pre-defined events for the light sensor -//! Sensor Plugin developer can add more event to their own headers - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @defgroup SENSOR_LIGHT Light Sensor - * @ingroup SENSOR_FRAMEWORK - * - * These APIs are used to control the light sensor. - * @{ - */ - -enum light_event_type { - LIGHT_LUX_DATA_EVENT = (LIGHT_SENSOR << 16) | 0x0001, - LIGHT_LEVEL_DATA_EVENT = (LIGHT_SENSOR << 16) | 0x0002, - LIGHT_CHANGE_LEVEL_EVENT = (LIGHT_SENSOR << 16) | 0x0004, -}; - -enum light_property_id { - LIGHT_PROPERTY_UNKNOWN = 0, -}; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif -//! End of a file diff --git a/src/shared/sensor_linear_accel.h b/src/shared/sensor_linear_accel.h deleted file mode 100755 index 306d1d6..0000000 --- a/src/shared/sensor_linear_accel.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * libsensord - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __SENSOR_LINEAR_ACCEL_H__ -#define __SENSOR_LINEAR_ACCEL_H__ - -//! Pre-defined events for the linear accelerometer sensor -//! Sensor Plugin developer can add more event to their own headers - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @defgroup SENSOR_LINEAR_ACCEL Linear Accelerometer Sensor - * @ingroup SENSOR_FRAMEWORK - * - * These APIs are used to control the Linear Accelerometer sensor. - * @{ - */ - -enum linear_accel_event_type { - LINEAR_ACCEL_RAW_DATA_EVENT = (LINEAR_ACCEL_SENSOR << 16) | 0x0001, -}; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif -//! End of a file diff --git a/src/shared/sensor_motion.h b/src/shared/sensor_motion.h deleted file mode 100755 index 1fe2db5..0000000 --- a/src/shared/sensor_motion.h +++ /dev/null @@ -1,150 +0,0 @@ -/* - * libsensord - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __SENSOR_MOTION_H__ -#define __SENSOR_MOTION_H__ - -//! Pre-defined events for the motion sensor -//! Sensor Plugin developer can add more event to their own headers - -#ifdef __cplusplus -extern "C" -{ -#endif - -enum motion_event_type { - MOTION_ENGINE_EVENT_SNAP = (MOTION_SENSOR << 16) | 0x0001, - MOTION_ENGINE_EVENT_SHAKE = (MOTION_SENSOR << 16) | 0x0002, - MOTION_ENGINE_EVENT_DOUBLETAP = (MOTION_SENSOR << 16) | 0x0004, - MOTION_ENGINE_EVENT_PANNING = (MOTION_SENSOR << 16) | 0x0008, - MOTION_ENGINE_EVENT_TOP_TO_BOTTOM = (MOTION_SENSOR << 16) | 0x0010, - MOTION_ENGINE_EVENT_DIRECT_CALL = (MOTION_SENSOR << 16) | 0x0020, - MOTION_ENGINE_EVENT_TILT_TO_UNLOCK = (MOTION_SENSOR << 16) | 0x0040, - MOTION_ENGINE_EVENT_LOCK_EXECUTE_CAMERA = (MOTION_SENSOR << 16) | 0x0080, - MOTION_ENGINE_EVENT_SMART_ALERT = (MOTION_SENSOR << 16) | 0x0100, - MOTION_ENGINE_EVENT_TILT = (MOTION_SENSOR << 16) | 0x0200, - MOTION_ENGINE_EVENT_PANNING_BROWSE = (MOTION_SENSOR << 16) | 0x0400, - MOTION_ENGINE_EVENT_NO_MOVE = (MOTION_SENSOR << 16) | 0x0800, - MOTION_ENGINE_EVENT_SHAKE_ALWAYS_ON = (MOTION_SENSOR << 16) | 0x1000, - MOTION_ENGINE_EVENT_SMART_RELAY = (MOTION_SENSOR << 16) | 0x2000, -}; - -enum motion_snap_event { - MOTION_ENGIEN_SNAP_NONE = 0, - MOTION_ENGIEN_NEGATIVE_SNAP_X = 1, - MOTION_ENGIEN_POSITIVE_SNAP_X = 2, - MOTION_ENGIEN_NEGATIVE_SNAP_Y = 3, - MOTION_ENGIEN_POSITIVE_SNAP_Y = 4, - MOTION_ENGIEN_NEGATIVE_SNAP_Z = 5, - MOTION_ENGIEN_POSITIVE_SNAP_Z = 6, - MOTION_ENGIEN_SNAP_LEFT = MOTION_ENGIEN_NEGATIVE_SNAP_X, - MOTION_ENGIEN_SNAP_RIGHT = MOTION_ENGIEN_POSITIVE_SNAP_X, - MOTION_ENGINE_SNAP_NONE = 0, - MOTION_ENGINE_NEGATIVE_SNAP_X = 1, - MOTION_ENGINE_POSITIVE_SNAP_X = 2, - MOTION_ENGINE_NEGATIVE_SNAP_Y = 3, - MOTION_ENGINE_POSITIVE_SNAP_Y = 4, - MOTION_ENGINE_NEGATIVE_SNAP_Z = 5, - MOTION_ENGINE_POSITIVE_SNAP_Z = 6, - MOTION_ENGINE_SNAP_LEFT = MOTION_ENGINE_NEGATIVE_SNAP_X, - MOTION_ENGINE_SNAP_RIGHT = MOTION_ENGINE_POSITIVE_SNAP_X, -}; - -enum motion_shake_event { - MOTION_ENGIEN_SHAKE_NONE = 0, - MOTION_ENGIEN_SHAKE_DETECTION = 1, - MOTION_ENGIEN_SHAKE_CONTINUING = 2, - MOTION_ENGIEN_SHAKE_FINISH = 3, - MOTION_ENGINE_SHAKE_BREAK = 4, - MOTION_ENGINE_SHAKE_NONE = 0, - MOTION_ENGINE_SHAKE_DETECTION = 1, - MOTION_ENGINE_SHAKE_CONTINUING = 2, - MOTION_ENGINE_SHAKE_FINISH = 3, -}; - -enum motion_doubletap_event { - MOTION_ENGIEN_DOUBLTAP_NONE = 0, - MOTION_ENGIEN_DOUBLTAP_DETECTION = 1, - MOTION_ENGINE_DOUBLTAP_NONE = 0, - MOTION_ENGINE_DOUBLTAP_DETECTION = 1, -}; - -enum motion_top_to_bottom_event { - MOTION_ENGIEN_TOP_TO_BOTTOM_NONE = 0, - MOTION_ENGIEN_TOP_TO_BOTTOM_WAIT = 1, - MOTION_ENGIEN_TOP_TO_BOTTOM_DETECTION = 2, - MOTION_ENGINE_TOP_TO_BOTTOM_NONE = 0, - MOTION_ENGINE_TOP_TO_BOTTOM_WAIT = 1, - MOTION_ENGINE_TOP_TO_BOTTOM_DETECTION = 2, -}; - -enum motion_direct_call_event_t { - MOTION_ENGINE_DIRECT_CALL_NONE, - MOTION_ENGINE_DIRECT_CALL_DETECTION, -}; - -enum motion_smart_relay_event_t { - MOTION_ENGINE_SMART_RELAY_NONE, - MOTION_ENGINE_SMART_RELAY_DETECTION, -}; - -enum motion_tilt_to_unlock_event_t { - MOTION_ENGINE_TILT_TO_UNLOCK_NONE, - MOTION_ENGINE_TILT_TO_UNLOCK_DETECTION, -}; - -enum motion_lock_execute_camera_event_t { - MOTION_ENGINE_LOCK_EXECUTE_CAMERA_NONE, - MOTION_ENGINE_LOCK_EXECUTE_CAMERA_L_DETECTION, - MOTION_ENGINE_LOCK_EXECUTE_CAMERA_R_DETECTION, -}; - -enum motion_smart_alert_t { - MOTION_ENGINE_SMART_ALERT_NONE, - MOTION_ENGINE_SMART_ALERT_DETECTION, -}; - -enum motion_no_move_t { - MOTION_ENGINE_NO_MOVE_NONE, - MOTION_ENGINE_NO_MOVE_DETECTION, -}; - -enum motion_property_id { - MOTION_PROPERTY_UNKNOWN = 0, - MOTION_PROPERTY_CHECK_ACCEL_SENSOR, - MOTION_PROPERTY_CHECK_GYRO_SENSOR, - MOTION_PROPERTY_CHECK_GEO_SENSOR, - MOTION_PROPERTY_CHECK_PRIXI_SENSOR, - MOTION_PROPERTY_CHECK_LIGHT_SENSOR, - MOTION_PROPERTY_CHECK_BARO_SENSOR, - MOTION_PROPERTY_LCD_TOUCH_ON, - MOTION_PROPERTY_LCD_TOUCH_OFF, - MOTION_PROPERTY_CHECK_GYRO_CAL_STATUS, -}; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif -//! End of a file diff --git a/src/shared/sensor_orientation.h b/src/shared/sensor_orientation.h deleted file mode 100755 index 5852e17..0000000 --- a/src/shared/sensor_orientation.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * libsensord - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __SENSOR_ORIENTATION_H__ -#define __SENSOR_ORIENTATION_H__ - -//! Pre-defined events for the orientation sensor -//! Sensor Plugin developer can add more event to their own headers - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @defgroup SENSOR_ORIENTATION Orientation Sensor - * @ingroup SENSOR_FRAMEWORK - * - * These APIs are used to control the Orientation sensor. - * @{ - */ - -enum orientation_event_type { - ORIENTATION_RAW_DATA_EVENT = (ORIENTATION_SENSOR << 16) | 0x0001, - ORIENTATION_CALIBRATION_NEEDED_EVENT = (ORIENTATION_SENSOR << 16) | 0x0002, -}; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif -//! End of a file diff --git a/src/shared/sensor_pressure.h b/src/shared/sensor_pressure.h deleted file mode 100755 index e06b39f..0000000 --- a/src/shared/sensor_pressure.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * libsensord - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __SENSOR_PRESSURE_H__ -#define __SENSOR_PRESSURE_H__ - -//! Pre-defined events for the pressurescope sensor -//! Sensor Plugin developer can add more event to their own headers - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @defgroup SENSOR_PRESSURE pressure Sensor - * @ingroup SENSOR_FRAMEWORK - * - * These APIs are used to control the pressure sensor. - * @{ - */ - -enum pressure_event_type { - PRESSURE_RAW_DATA_EVENT = (PRESSURE_SENSOR << 16) | 0x0001, -}; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif -//! End of a file diff --git a/src/shared/sensor_proxi.h b/src/shared/sensor_proxi.h deleted file mode 100755 index 1c99fa4..0000000 --- a/src/shared/sensor_proxi.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * libsensord - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __SENSOR_PROXI_H__ -#define __SENSOR_PROXI_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @defgroup SENSOR_PROXY Proximity Sensor - * @ingroup SENSOR_FRAMEWORK - * - * These APIs are used to control the Proxymaty sensor. - * @{ - */ - -enum proxi_event_type { - PROXIMITY_CHANGE_STATE_EVENT = (PROXIMITY_SENSOR << 16) | 0x0001, - PROXIMITY_STATE_EVENT = (PROXIMITY_SENSOR << 16) | 0x0002, - PROXIMITY_DISTANCE_DATA_EVENT = (PROXIMITY_SENSOR << 16) | 0x0004, -}; - -enum proxi_change_state { - PROXIMITY_STATE_FAR = 0, - PROXIMITY_STATE_NEAR = 1, -}; - -enum proxi_property_id { - PROXIMITY_PROPERTY_UNKNOWN = 0, -}; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif -//! End of a file diff --git a/src/shared/sensor_rv.h b/src/shared/sensor_rv.h deleted file mode 100755 index 3e65acc..0000000 --- a/src/shared/sensor_rv.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * libsensord - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __SENSOR_ROTATION_VECTOR_H__ -#define __SENSOR_ROTATION_VECTOR_H__ - -//! Pre-defined events for the rotation vector sensor -//! Sensor Plugin developer can add more event to their own headers - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @defgroup SENSOR_RV Rotation Vector Sensor - * @ingroup SENSOR_FRAMEWORK - * - * These APIs are used to control the Rotation Vector sensor. - * @{ - */ - -enum rot_event_type { - ROTATION_VECTOR_RAW_DATA_EVENT = (ROTATION_VECTOR_SENSOR << 16) | 0x0001, -}; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif -//! End of a file - diff --git a/src/shared/sensor_temperature.h b/src/shared/sensor_temperature.h deleted file mode 100755 index 2af4cc8..0000000 --- a/src/shared/sensor_temperature.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * libsensord - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __SENSOR_TEMPERATURE_H__ -#define __SENSOR_TEMPERATURE_H__ - -//! Pre-defined events for the temperature scope sensor -//! Sensor Plugin developer can add more event to their own headers - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @defgroup SENSOR_TEMPERATURE temperature Sensor - * @ingroup SENSOR_FRAMEWORK - * - * These APIs are used to control the temperature sensor. - * @{ - */ - -enum temperature_event_type { - TEMPERATURE_RAW_DATA_EVENT = (TEMPERATURE_SENSOR << 16) | 0x0001, -}; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif -//! End of a file diff --git a/src/shared/sensor_tilt.h b/src/shared/sensor_tilt.h deleted file mode 100644 index 8b15d01..0000000 --- a/src/shared/sensor_tilt.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * libsensord - * - * Copyright (c) 2015 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __SENSOR_TILT_H__ -#define __SENSOR_TILT_H__ - -//! Pre-defined events for the tilt sensor -//! Sensor Plugin developer can add more event to their own headers - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @defgroup SENSOR_TILT tilt Sensor - * @ingroup SENSOR_FRAMEWORK - * - * These APIs are used to control the tilt sensor. - * @{ - */ - -enum tilt_event_type { - TILT_RAW_DATA_EVENT = (TILT_SENSOR << 16) | 0x0001, -}; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif -//! End of a file diff --git a/src/shared/sensor_types.h b/src/shared/sensor_types.h new file mode 100644 index 0000000..254213f --- /dev/null +++ b/src/shared/sensor_types.h @@ -0,0 +1,267 @@ +#ifndef _SENSOR_TYPES_H_ +#define _SENSOR_TYPES_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +// Accelerometer +enum accelerometer_event_type { + ACCELEROMETER_RAW_DATA_EVENT = (ACCELEROMETER_SENSOR << 16) | 0x0001, + ACCELEROMETER_UNPROCESSED_DATA_EVENT = (ACCELEROMETER_SENSOR << 16) | 0x0002, +}; + +// Gyroscope +enum gyro_event_type { + GYROSCOPE_RAW_DATA_EVENT = (GYROSCOPE_SENSOR << 16) | 0x0001, + GYROSCOPE_UNPROCESSED_DATA_EVENT = (GYROSCOPE_SENSOR << 16) | 0x0002, +}; + +// Geomagnetic +enum geomag_event_type { + GEOMAGNETIC_RAW_DATA_EVENT = (GEOMAGNETIC_SENSOR << 16) | 0x0001, + GEOMAGNETIC_CALIBRATION_NEEDED_EVENT = (GEOMAGNETIC_SENSOR << 16) | 0x0002, + GEOMAGNETIC_UNPROCESSED_DATA_EVENT = (GEOMAGNETIC_SENSOR << 16) | 0x0003, +}; + +// Proximity +enum proxi_event_type { + PROXIMITY_CHANGE_STATE_EVENT = (PROXIMITY_SENSOR << 16) | 0x0001, + PROXIMITY_STATE_EVENT = (PROXIMITY_SENSOR << 16) | 0x0002, + PROXIMITY_DISTANCE_DATA_EVENT = (PROXIMITY_SENSOR << 16) | 0x0004, +}; + +enum proxi_change_state { + PROXIMITY_STATE_FAR = 0, + PROXIMITY_STATE_NEAR = 1, +}; + +enum proxi_property_id { + PROXIMITY_PROPERTY_UNKNOWN = 0, +}; + +// Pressure +enum pressure_event_type { + PRESSURE_RAW_DATA_EVENT = (PRESSURE_SENSOR << 16) | 0x0001, +}; + +// Temperature +enum temperature_event_type { + TEMPERATURE_RAW_DATA_EVENT = (TEMPERATURE_SENSOR << 16) | 0x0001, +}; + +// Light +enum light_event_type { + LIGHT_LUX_DATA_EVENT = (LIGHT_SENSOR << 16) | 0x0001, + LIGHT_LEVEL_DATA_EVENT = (LIGHT_SENSOR << 16) | 0x0002, + LIGHT_CHANGE_LEVEL_EVENT = (LIGHT_SENSOR << 16) | 0x0004, +}; + +enum light_property_id { + LIGHT_PROPERTY_UNKNOWN = 0, +}; + +// Rotation Vector +enum rot_event_type { + ROTATION_VECTOR_RAW_DATA_EVENT = (ROTATION_VECTOR_SENSOR << 16) | 0x0001, +}; + +// Ultraviolet +enum ultraviolet_event_type { + ULTRAVIOLET_RAW_DATA_EVENT = (ULTRAVIOLET_SENSOR << 16) | 0x0001, +}; + +// Auto rotation +enum auto_rotation_event_type { + AUTO_ROTATION_CHANGE_STATE_EVENT = (AUTO_ROTATION_SENSOR << 16) | 0x0001, +}; + +enum auto_rotation_state { + AUTO_ROTATION_DEGREE_UNKNOWN = 0, + AUTO_ROTATION_DEGREE_0, + AUTO_ROTATION_DEGREE_90, + AUTO_ROTATION_DEGREE_180, + AUTO_ROTATION_DEGREE_270, +}; + +// Bio LED Red +enum bio_led_green_event_type { + BIO_LED_RED_RAW_DATA_EVENT = (BIO_LED_RED_SENSOR << 16) | 0x0001, +}; + +// Gaming RV +enum gaming_rv_event_type { + GAMING_RV_RAW_DATA_EVENT = (GAMING_RV_SENSOR << 16) | 0x0001, +}; + +// Context +enum context_event_type { + CONTEXT_REPORT_EVENT = (CONTEXT_SENSOR << 16) | 0x0001, +}; + +enum context_property_id { + CONTEXT_PROPERTY_UNKNOWN = 0, +}; + +// Geomagnetic RV +enum geomagnetic_rv_event_type { + GEOMAGNETIC_RV_RAW_DATA_EVENT = (GEOMAGNETIC_RV_SENSOR << 16) | 0x0001, +}; + +// Gravity +enum gravity_event_type { + GRAVITY_RAW_DATA_EVENT = (GRAVITY_SENSOR << 16) | 0x0001, +}; + +// Linear Acceleration +enum linear_accel_event_type { + LINEAR_ACCEL_RAW_DATA_EVENT = (LINEAR_ACCEL_SENSOR << 16) | 0x0001, +}; + +// Motion +enum motion_event_type { + MOTION_ENGINE_EVENT_SNAP = (MOTION_SENSOR << 16) | 0x0001, + MOTION_ENGINE_EVENT_SHAKE = (MOTION_SENSOR << 16) | 0x0002, + MOTION_ENGINE_EVENT_DOUBLETAP = (MOTION_SENSOR << 16) | 0x0004, + MOTION_ENGINE_EVENT_PANNING = (MOTION_SENSOR << 16) | 0x0008, + MOTION_ENGINE_EVENT_TOP_TO_BOTTOM = (MOTION_SENSOR << 16) | 0x0010, + MOTION_ENGINE_EVENT_DIRECT_CALL = (MOTION_SENSOR << 16) | 0x0020, + MOTION_ENGINE_EVENT_TILT_TO_UNLOCK = (MOTION_SENSOR << 16) | 0x0040, + MOTION_ENGINE_EVENT_LOCK_EXECUTE_CAMERA = (MOTION_SENSOR << 16) | 0x0080, + MOTION_ENGINE_EVENT_SMART_ALERT = (MOTION_SENSOR << 16) | 0x0100, + MOTION_ENGINE_EVENT_TILT = (MOTION_SENSOR << 16) | 0x0200, + MOTION_ENGINE_EVENT_PANNING_BROWSE = (MOTION_SENSOR << 16) | 0x0400, + MOTION_ENGINE_EVENT_NO_MOVE = (MOTION_SENSOR << 16) | 0x0800, + MOTION_ENGINE_EVENT_SHAKE_ALWAYS_ON = (MOTION_SENSOR << 16) | 0x1000, + MOTION_ENGINE_EVENT_SMART_RELAY = (MOTION_SENSOR << 16) | 0x2000, +}; + +enum motion_snap_event { + MOTION_ENGIEN_SNAP_NONE = 0, + MOTION_ENGIEN_NEGATIVE_SNAP_X = 1, + MOTION_ENGIEN_POSITIVE_SNAP_X = 2, + MOTION_ENGIEN_NEGATIVE_SNAP_Y = 3, + MOTION_ENGIEN_POSITIVE_SNAP_Y = 4, + MOTION_ENGIEN_NEGATIVE_SNAP_Z = 5, + MOTION_ENGIEN_POSITIVE_SNAP_Z = 6, + MOTION_ENGIEN_SNAP_LEFT = MOTION_ENGIEN_NEGATIVE_SNAP_X, + MOTION_ENGIEN_SNAP_RIGHT = MOTION_ENGIEN_POSITIVE_SNAP_X, + MOTION_ENGINE_SNAP_NONE = 0, + MOTION_ENGINE_NEGATIVE_SNAP_X = 1, + MOTION_ENGINE_POSITIVE_SNAP_X = 2, + MOTION_ENGINE_NEGATIVE_SNAP_Y = 3, + MOTION_ENGINE_POSITIVE_SNAP_Y = 4, + MOTION_ENGINE_NEGATIVE_SNAP_Z = 5, + MOTION_ENGINE_POSITIVE_SNAP_Z = 6, + MOTION_ENGINE_SNAP_LEFT = MOTION_ENGINE_NEGATIVE_SNAP_X, + MOTION_ENGINE_SNAP_RIGHT = MOTION_ENGINE_POSITIVE_SNAP_X, +}; + +enum motion_shake_event { + MOTION_ENGIEN_SHAKE_NONE = 0, + MOTION_ENGIEN_SHAKE_DETECTION = 1, + MOTION_ENGIEN_SHAKE_CONTINUING = 2, + MOTION_ENGIEN_SHAKE_FINISH = 3, + MOTION_ENGINE_SHAKE_BREAK = 4, + MOTION_ENGINE_SHAKE_NONE = 0, + MOTION_ENGINE_SHAKE_DETECTION = 1, + MOTION_ENGINE_SHAKE_CONTINUING = 2, + MOTION_ENGINE_SHAKE_FINISH = 3, +}; + +enum motion_doubletap_event { + MOTION_ENGIEN_DOUBLTAP_NONE = 0, + MOTION_ENGIEN_DOUBLTAP_DETECTION = 1, + MOTION_ENGINE_DOUBLTAP_NONE = 0, + MOTION_ENGINE_DOUBLTAP_DETECTION = 1, +}; + +enum motion_top_to_bottom_event { + MOTION_ENGIEN_TOP_TO_BOTTOM_NONE = 0, + MOTION_ENGIEN_TOP_TO_BOTTOM_WAIT = 1, + MOTION_ENGIEN_TOP_TO_BOTTOM_DETECTION = 2, + MOTION_ENGINE_TOP_TO_BOTTOM_NONE = 0, + MOTION_ENGINE_TOP_TO_BOTTOM_WAIT = 1, + MOTION_ENGINE_TOP_TO_BOTTOM_DETECTION = 2, +}; + +enum motion_direct_call_event_t { + MOTION_ENGINE_DIRECT_CALL_NONE, + MOTION_ENGINE_DIRECT_CALL_DETECTION, +}; + +enum motion_smart_relay_event_t { + MOTION_ENGINE_SMART_RELAY_NONE, + MOTION_ENGINE_SMART_RELAY_DETECTION, +}; + +enum motion_tilt_to_unlock_event_t { + MOTION_ENGINE_TILT_TO_UNLOCK_NONE, + MOTION_ENGINE_TILT_TO_UNLOCK_DETECTION, +}; + +enum motion_lock_execute_camera_event_t { + MOTION_ENGINE_LOCK_EXECUTE_CAMERA_NONE, + MOTION_ENGINE_LOCK_EXECUTE_CAMERA_L_DETECTION, + MOTION_ENGINE_LOCK_EXECUTE_CAMERA_R_DETECTION, +}; + +enum motion_smart_alert_t { + MOTION_ENGINE_SMART_ALERT_NONE, + MOTION_ENGINE_SMART_ALERT_DETECTION, +}; + +enum motion_no_move_t { + MOTION_ENGINE_NO_MOVE_NONE, + MOTION_ENGINE_NO_MOVE_DETECTION, +}; + +enum motion_property_id { + MOTION_PROPERTY_UNKNOWN = 0, + MOTION_PROPERTY_CHECK_ACCEL_SENSOR, + MOTION_PROPERTY_CHECK_GYRO_SENSOR, + MOTION_PROPERTY_CHECK_GEO_SENSOR, + MOTION_PROPERTY_CHECK_PRIXI_SENSOR, + MOTION_PROPERTY_CHECK_LIGHT_SENSOR, + MOTION_PROPERTY_CHECK_BARO_SENSOR, + MOTION_PROPERTY_LCD_TOUCH_ON, + MOTION_PROPERTY_LCD_TOUCH_OFF, + MOTION_PROPERTY_CHECK_GYRO_CAL_STATUS, +}; + +// Orientation +enum orientation_event_type { + ORIENTATION_RAW_DATA_EVENT = (ORIENTATION_SENSOR << 16) | 0x0001, + ORIENTATION_CALIBRATION_NEEDED_EVENT = (ORIENTATION_SENSOR << 16) | 0x0002, +}; + +// Tilt +enum tilt_event_type { + TILT_RAW_DATA_EVENT = (TILT_SENSOR << 16) | 0x0001, +}; + +// Uncalibrated Gyroscope +enum uncal_gyro_event_type { + UNCAL_GYRO_RAW_DATA_EVENT = (UNCAL_GYROSCOPE_SENSOR << 16) | 0x0001, +}; + +// Fusion +enum fusion_event_type { + FUSION_EVENT = (FUSION_SENSOR << 16) | 0x0001, + FUSION_UNCAL_GYRO_EVENT = (FUSION_SENSOR << 16) | 0x0002, + FUSION_CALIBRATION_NEEDED_EVENT = (FUSION_SENSOR << 16) | 0x0003, + FUSION_ORIENTATION_ENABLED = (FUSION_SENSOR << 16) | 0x0004, + FUSION_ROTATION_VECTOR_ENABLED = (FUSION_SENSOR << 16) | 0x0005, + FUSION_GAMING_ROTATION_VECTOR_ENABLED = (FUSION_SENSOR << 16) | 0x0006, + FUSION_GEOMAGNETIC_ROTATION_VECTOR_ENABLED = (FUSION_SENSOR << 16) | 0x0007, + FUSION_TILT_ENABLED = (FUSION_SENSOR << 16) | 0x0008, + FUSION_UNCAL_GYRO_ENABLED = (FUSION_SENSOR << 16) | 0x0009, +}; + + +#ifdef __cplusplus +} +#endif + +#endif /* _SENSOR_TYPES_H_ */ diff --git a/src/shared/sensor_ultraviolet.h b/src/shared/sensor_ultraviolet.h deleted file mode 100644 index 0116221..0000000 --- a/src/shared/sensor_ultraviolet.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * libsensord - * - * Copyright (c) 2015 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __SENSOR_ULTRAVIOLET_H__ -#define __SENSOR_ULTRAVIOLET_H__ - -//! Pre-defined events for the ultraviolet sensor -//! Sensor Plugin developer can add more event to their own headers - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @defgroup SENSOR_ULTRAVIOLET Ultra Violet Sensor - * @ingroup SENSOR_FRAMEWORK - * - * These APIs are used to control the ultraviolet sensor. - * @{ - */ - -enum ultraviolet_event_type { - ULTRAVIOLET_RAW_DATA_EVENT = (ULTRAVIOLET_SENSOR << 16) | 0x0001, -}; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif -//! End of a file diff --git a/src/shared/sensor_uncal_gyro.h b/src/shared/sensor_uncal_gyro.h deleted file mode 100644 index 92494a7..0000000 --- a/src/shared/sensor_uncal_gyro.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * libsensord - * - * Copyright (c) 2015 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __SENSOR_UNCAL_GYRO_H__ -#define __SENSOR_UNCAL_GYRO_H__ - -//! Pre-defined events for the uncal gyroscope sensor -//! Sensor Plugin developer can add more event to their own headers - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @defgroup UNCAL_SENSOR_GYRO Gyro Sensor - * @ingroup SENSOR_FRAMEWORK - * - * These APIs are used to control the gyro sensor. - * @{ - */ - -enum uncal_gyro_event_type { - UNCAL_GYRO_RAW_DATA_EVENT = (UNCAL_GYROSCOPE_SENSOR << 16) | 0x0001, -}; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif -//! End of a file -- 2.7.4 From aebe1035ed1dfadedaa2bbc3b6fd0b36fef01421 Mon Sep 17 00:00:00 2001 From: Adarsh Shree Ram Date: Tue, 3 Nov 2015 17:14:03 +0530 Subject: [PATCH 09/16] Changes as per the new sensord structure -UPdated CMakelists and spec files as per the new sensord structure -updated header file inclusions as per the new file names -moved files from shared to server folder Change-Id: I06d7387d1c4a7dc0851e0ece7df0c11ddaa10b22 --- packaging/sensord.spec | 1 - src/CMakeLists.txt | 83 ------ src/client/CMakeLists.txt | 2 +- src/client/client.cpp | 2 +- src/client/client_common.h | 2 +- src/client/csensor_handle_info.h | 2 +- src/client/poller.cpp | 2 +- src/server/CMakeLists.txt | 112 ++++++++- src/server/cclient_info_manager.cpp | 2 +- src/server/cclient_info_manager.h | 2 +- src/server/cclient_sensor_record.cpp | 2 +- src/server/cconfig.h | 2 +- src/server/command_worker.cpp | 7 +- src/server/csensor_event_dispatcher.cpp | 2 +- src/server/csensor_event_queue.cpp | 2 +- src/server/csensor_usage.cpp | 2 +- src/server/cvirtual_sensor_config.cpp | 2 +- src/server/dbus_util.cpp | 2 +- src/server/main.cpp | 2 +- src/server/permission_checker.cpp | 2 +- src/server/plugins/accel/accel_sensor.cpp | 2 +- .../plugins/auto_rotation/auto_rotation_alg.cpp | 2 +- .../auto_rotation/auto_rotation_alg_emul.cpp | 4 +- .../plugins/auto_rotation/auto_rotation_sensor.cpp | 2 +- .../plugins/bio_led_red/bio_led_red_sensor.cpp | 2 +- src/server/plugins/fusion/CMakeLists.txt | 2 +- src/server/plugins/fusion/fusion_sensor.cpp | 2 +- src/server/plugins/geo/geo_sensor.cpp | 2 +- src/server/plugins/gravity/CMakeLists.txt | 2 +- src/server/plugins/gravity/gravity_sensor.cpp | 2 +- src/server/plugins/gyro/gyro_sensor.cpp | 2 +- src/server/plugins/light/light_sensor.cpp | 2 +- src/server/plugins/linear_accel/CMakeLists.txt | 2 +- .../plugins/linear_accel/linear_accel_sensor.cpp | 2 +- src/server/plugins/orientation/CMakeLists.txt | 2 +- .../plugins/orientation/orientation_sensor.cpp | 2 +- src/server/plugins/pressure/pressure_sensor.cpp | 2 +- src/server/plugins/proxi/proxi_sensor.cpp | 2 +- .../rotation_vector/gaming_rv/CMakeLists.txt | 2 +- .../rotation_vector/gaming_rv/gaming_rv_sensor.cpp | 2 +- .../rotation_vector/geomagnetic_rv/CMakeLists.txt | 2 +- .../geomagnetic_rv/geomagnetic_rv_sensor.cpp | 2 +- .../plugins/rotation_vector/rv/CMakeLists.txt | 2 +- .../plugins/rotation_vector/rv/rv_sensor.cpp | 2 +- .../rotation_vector/rv_raw/rv_raw_sensor.cpp | 2 +- .../plugins/temperature/temperature_sensor.cpp | 2 +- src/server/plugins/tilt/CMakeLists.txt | 2 +- src/server/plugins/tilt/tilt_sensor.cpp | 2 +- .../plugins/ultraviolet/ultraviolet_sensor.cpp | 2 +- src/server/plugins/uncal_gyro/CMakeLists.txt | 2 +- .../plugins/uncal_gyro/uncal_gyro_sensor.cpp | 2 +- src/server/sensor_base.h | 2 +- src/{shared => server}/sensor_plugin_loader.cpp | 2 +- src/{shared => server}/sensor_plugin_loader.h | 0 src/server/worker_thread.cpp | 2 +- src/shared/CMakeLists.txt | 58 +---- src/shared/cbase_lock.cpp | 2 +- src/shared/cmutex.cpp | 2 +- src/shared/cpacket.cpp | 2 +- src/shared/csensor_config.cpp | 279 +++++++++++++++++++++ src/shared/csensor_config.h | 95 +++++++ src/shared/csocket.h | 2 +- src/shared/sensor_info.cpp | 2 +- src/shared/{common.cpp => sensor_logs.cpp} | 2 +- src/shared/{common.h => sensor_logs.h} | 0 src/shared/sf_common.h | 2 +- 66 files changed, 551 insertions(+), 200 deletions(-) rename src/{shared => server}/sensor_plugin_loader.cpp (99%) rename src/{shared => server}/sensor_plugin_loader.h (100%) create mode 100755 src/shared/csensor_config.cpp create mode 100755 src/shared/csensor_config.h rename src/shared/{common.cpp => sensor_logs.cpp} (99%) rename src/shared/{common.h => sensor_logs.h} (100%) diff --git a/packaging/sensord.spec b/packaging/sensord.spec index 92d9bad..ed87346 100644 --- a/packaging/sensord.spec +++ b/packaging/sensord.spec @@ -16,7 +16,6 @@ BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(vconf) BuildRequires: pkgconfig(libsystemd-daemon) BuildRequires: pkgconfig(capi-system-info) -BuildRequires: pkgconfig(sensor-hal) BuildRequires: pkgconfig(cynara-creds-socket) BuildRequires: pkgconfig(cynara-client) BuildRequires: pkgconfig(cynara-session) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c3b2022..862064f 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,89 +4,6 @@ project(sensord_src CXX) include_directories(${CMAKE_SOURCE_DIR}/src/shared) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -IF("${ACCEL}" STREQUAL "ON") -add_subdirectory(plugins/accel) -ENDIF() -IF("${GYRO}" STREQUAL "ON") -add_subdirectory(plugins/gyro) -ENDIF() -IF("${PROXI}" STREQUAL "ON") -add_subdirectory(plugins/proxi) -ENDIF() -IF("${LIGHT}" STREQUAL "ON") -add_subdirectory(plugins/light) -ENDIF() -IF("${GEO}" STREQUAL "ON") -add_subdirectory(plugins/geo) -ENDIF() -IF("${AUTO_ROTATION}" STREQUAL "ON") -add_subdirectory(plugins/auto_rotation) -ENDIF() -IF("${PRESSURE}" STREQUAL "ON") -add_subdirectory(plugins/pressure) -ENDIF() -IF("${TEMPERATURE}" STREQUAL "ON") -add_subdirectory(plugins/temperature) -ENDIF() -IF("${HUMIDITY}" STREQUAL "ON") -add_subdirectory(humidity) -ENDIF() -IF("${ULTRAVIOLET}" STREQUAL "ON") -add_subdirectory(plugins/ultraviolet) -ENDIF() -IF("${BIO_LED_RED}" STREQUAL "ON") -add_subdirectory(plugins/bio_led_red) -ENDIF() -IF("${ORIENTATION}" STREQUAL "ON") -set(SENSOR_FUSION_ENABLE "1") -set(ORIENTATION_ENABLE "1") -ENDIF() -IF("${GEOMAGNETIC_RV}" STREQUAL "ON") -set(SENSOR_FUSION_ENABLE "1") -ENDIF() -IF("${GAMING_RV}" STREQUAL "ON") -set(SENSOR_FUSION_ENABLE "1") -ENDIF() -IF("${TILT}" STREQUAL "ON") -set(SENSOR_FUSION_ENABLE "1") -set(TILT_ENABLE "1") -ENDIF() -IF("${UNCAL_GYRO}" STREQUAL "ON") -set(SENSOR_FUSION_ENABLE "1") -set(UNCAL_GYRO_ENABLE "1") -ENDIF() -IF("${GRAVITY}" STREQUAL "ON") -set(SENSOR_FUSION_ENABLE "1") -set(ORIENTATION_ENABLE "1") -set(GRAVITY_ENABLE "1") -ENDIF() -IF("${LINEAR_ACCEL}" STREQUAL "ON") -set(SENSOR_FUSION_ENABLE "1") -set(ORIENTATION_ENABLE "1") -set(GRAVITY_ENABLE "1") -set(LINEAR_ACCELERATION_ENABLE "1") -ENDIF() -IF("${SENSOR_FUSION_ENABLE}" STREQUAL "1") -add_subdirectory(plugins/sensor_fusion) -add_subdirectory(plugins/fusion) -ENDIF() -IF("${ORIENTATION_ENABLE}" STREQUAL "1") -add_subdirectory(plugins/orientation) -ENDIF() -IF("${GRAVITY_ENABLE}" STREQUAL "1") -add_subdirectory(plugins/gravity) -ENDIF() -IF("${LINEAR_ACCELERATION_ENABLE}" STREQUAL "1") -add_subdirectory(plugins/linear_accel) -ENDIF() -IF("${TILT_ENABLE}" STREQUAL "1") -add_subdirectory(plugins/tilt) -ENDIF() -IF("${UNCAL_GYRO_ENABLE}" STREQUAL "1") -add_subdirectory(plugins/uncal_gyro) -ENDIF() - -add_subdirectory(plugins/rotation_vector) add_subdirectory(server) add_subdirectory(client) add_subdirectory(shared) diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index d85785c..3f989c8 100755 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -29,7 +29,7 @@ add_library(${PROJECT_NAME} SHARED poller.cpp ) -target_link_libraries(${PROJECT_NAME} ${lib_pkgs_LDFLAGS} "sensord-share" "sensor-hal") +target_link_libraries(${PROJECT_NAME} ${lib_pkgs_LDFLAGS} "sensord-share") SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR}) SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION}) diff --git a/src/client/client.cpp b/src/client/client.cpp index 9167a7a..fd9c84a 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/client/client_common.h b/src/client/client_common.h index 5d6a752..db3ae6d 100755 --- a/src/client/client_common.h +++ b/src/client/client_common.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #define BASE_GATHERING_INTERVAL 100 diff --git a/src/client/csensor_handle_info.h b/src/client/csensor_handle_info.h index 51fb8be..6a22dc9 100644 --- a/src/client/csensor_handle_info.h +++ b/src/client/csensor_handle_info.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include diff --git a/src/client/poller.cpp b/src/client/poller.cpp index 64292e5..e174caf 100755 --- a/src/client/poller.cpp +++ b/src/client/poller.cpp @@ -16,7 +16,7 @@ * limitations under the License. * */ -#include +#include #include #include diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt index 4d4ebfb..f751ecc 100755 --- a/src/server/CMakeLists.txt +++ b/src/server/CMakeLists.txt @@ -2,8 +2,7 @@ cmake_minimum_required(VERSION 2.6) project(sensord CXX) INCLUDE(FindPkgConfig) -PKG_CHECK_MODULES(server_pkgs REQUIRED glib-2.0 gio-2.0 dlog libsystemd-daemon cynara-client cynara-creds-socket cynara-session) - +PKG_CHECK_MODULES(server_pkgs REQUIRED glib-2.0 gio-2.0 dlog libsystemd-daemon libxml-2.0 cynara-client cynara-creds-socket cynara-session) FOREACH(flag ${server_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") ENDFOREACH(flag) @@ -24,10 +23,117 @@ SET(SERVER_SRCS command_worker.cpp permission_checker.cpp main.cpp + +) + +add_library(sensord-server SHARED + worker_thread.cpp + cvirtual_sensor_config.cpp + csensor_event_queue.cpp + csensor_event_dispatcher.cpp + csensor_usage.cpp + cplugin_info_list.cpp + sensor_plugin_loader.cpp + sensor_base.cpp + physical_sensor.cpp + virtual_sensor.cpp + cclient_info_manager.cpp + cclient_sensor_record.cpp + cconfig.cpp ) +target_link_libraries(sensord-server ${shared_pkgs_LDFLAGS} "-lrt -ldl -pthread" "sensord-share") +configure_file(sensord-server.pc.in ${CMAKE_CURRENT_SOURCE_DIR}/sensord-server.pc @ONLY) +install(TARGETS sensord-server DESTINATION ${CMAKE_INSTALL_LIBDIR}) +install(FILES sensord-server.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) add_executable(${PROJECT_NAME} ${SERVER_SRCS}) -target_link_libraries(${PROJECT_NAME} ${server_pkgs_LDFLAGS} "sensord-server" "sensor-hal") +target_link_libraries(${PROJECT_NAME} ${server_pkgs_LDFLAGS} "sensord-server") install(TARGETS ${PROJECT_NAME} DESTINATION bin) + + + +IF("${ACCEL}" STREQUAL "ON") +add_subdirectory(plugins/accel) +ENDIF() +IF("${GYRO}" STREQUAL "ON") +add_subdirectory(plugins/gyro) +ENDIF() +IF("${PROXI}" STREQUAL "ON") +add_subdirectory(plugins/proxi) +ENDIF() +IF("${LIGHT}" STREQUAL "ON") +add_subdirectory(plugins/light) +ENDIF() +IF("${GEO}" STREQUAL "ON") +add_subdirectory(plugins/geo) +ENDIF() +IF("${AUTO_ROTATION}" STREQUAL "ON") +add_subdirectory(plugins/auto_rotation) +ENDIF() +IF("${PRESSURE}" STREQUAL "ON") +add_subdirectory(plugins/pressure) +ENDIF() +IF("${TEMPERATURE}" STREQUAL "ON") +add_subdirectory(plugins/temperature) +ENDIF() +IF("${HUMIDITY}" STREQUAL "ON") +add_subdirectory(humidity) +ENDIF() +IF("${ULTRAVIOLET}" STREQUAL "ON") +add_subdirectory(plugins/ultraviolet) +ENDIF() +IF("${BIO_LED_RED}" STREQUAL "ON") +add_subdirectory(plugins/bio_led_red) +ENDIF() +IF("${ORIENTATION}" STREQUAL "ON") +set(SENSOR_FUSION_ENABLE "1") +set(ORIENTATION_ENABLE "1") +ENDIF() +IF("${GEOMAGNETIC_RV}" STREQUAL "ON") +set(SENSOR_FUSION_ENABLE "1") +ENDIF() +IF("${GAMING_RV}" STREQUAL "ON") +set(SENSOR_FUSION_ENABLE "1") +ENDIF() +IF("${TILT}" STREQUAL "ON") +set(SENSOR_FUSION_ENABLE "1") +set(TILT_ENABLE "1") +ENDIF() +IF("${UNCAL_GYRO}" STREQUAL "ON") +set(SENSOR_FUSION_ENABLE "1") +set(UNCAL_GYRO_ENABLE "1") +ENDIF() +IF("${GRAVITY}" STREQUAL "ON") +set(SENSOR_FUSION_ENABLE "1") +set(ORIENTATION_ENABLE "1") +set(GRAVITY_ENABLE "1") +ENDIF() +IF("${LINEAR_ACCEL}" STREQUAL "ON") +set(SENSOR_FUSION_ENABLE "1") +set(ORIENTATION_ENABLE "1") +set(GRAVITY_ENABLE "1") +set(LINEAR_ACCELERATION_ENABLE "1") +ENDIF() +IF("${SENSOR_FUSION_ENABLE}" STREQUAL "1") +add_subdirectory(sensor_fusion) +add_subdirectory(plugins/fusion) +ENDIF() +IF("${ORIENTATION_ENABLE}" STREQUAL "1") +add_subdirectory(plugins/orientation) +ENDIF() +IF("${GRAVITY_ENABLE}" STREQUAL "1") +add_subdirectory(plugins/gravity) +ENDIF() +IF("${LINEAR_ACCELERATION_ENABLE}" STREQUAL "1") +add_subdirectory(plugins/linear_accel) +ENDIF() +IF("${TILT_ENABLE}" STREQUAL "1") +add_subdirectory(plugins/tilt) +ENDIF() +IF("${UNCAL_GYRO_ENABLE}" STREQUAL "1") +add_subdirectory(plugins/uncal_gyro) +ENDIF() + +add_subdirectory(plugins/rotation_vector) diff --git a/src/server/cclient_info_manager.cpp b/src/server/cclient_info_manager.cpp index 4877972..540491c 100644 --- a/src/server/cclient_info_manager.cpp +++ b/src/server/cclient_info_manager.cpp @@ -18,7 +18,7 @@ */ #include -#include +#include #include using std::pair; diff --git a/src/server/cclient_info_manager.h b/src/server/cclient_info_manager.h index c6f79e3..f49b324 100644 --- a/src/server/cclient_info_manager.h +++ b/src/server/cclient_info_manager.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include diff --git a/src/server/cclient_sensor_record.cpp b/src/server/cclient_sensor_record.cpp index d6b1432..24d4c6c 100644 --- a/src/server/cclient_sensor_record.cpp +++ b/src/server/cclient_sensor_record.cpp @@ -18,7 +18,7 @@ */ #include -#include +#include using std::pair; using std::string; diff --git a/src/server/cconfig.h b/src/server/cconfig.h index dd23b11..ef2802f 100755 --- a/src/server/cconfig.h +++ b/src/server/cconfig.h @@ -22,7 +22,7 @@ #include #include -#include +#include class cconfig { diff --git a/src/server/command_worker.cpp b/src/server/command_worker.cpp index f8148de..dd8cab2 100644 --- a/src/server/command_worker.cpp +++ b/src/server/command_worker.cpp @@ -20,12 +20,7 @@ #include #include #include -#include -#include -#include -#include -#include -#include +#include #include #include #include diff --git a/src/server/csensor_event_dispatcher.cpp b/src/server/csensor_event_dispatcher.cpp index 8b23060..e82b6e2 100644 --- a/src/server/csensor_event_dispatcher.cpp +++ b/src/server/csensor_event_dispatcher.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/server/csensor_event_queue.cpp b/src/server/csensor_event_queue.cpp index ed95497..f75fa42 100644 --- a/src/server/csensor_event_queue.cpp +++ b/src/server/csensor_event_queue.cpp @@ -18,7 +18,7 @@ */ #include -#include "common.h" +#include "sensor_logs.h" csensor_event_queue& csensor_event_queue::get_instance() { diff --git a/src/server/csensor_usage.cpp b/src/server/csensor_usage.cpp index ad9d750..0e06826 100644 --- a/src/server/csensor_usage.cpp +++ b/src/server/csensor_usage.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include csensor_usage::csensor_usage() : m_interval(POLL_MAX_HZ_MS) diff --git a/src/server/cvirtual_sensor_config.cpp b/src/server/cvirtual_sensor_config.cpp index a636e87..25538ce 100755 --- a/src/server/cvirtual_sensor_config.cpp +++ b/src/server/cvirtual_sensor_config.cpp @@ -18,7 +18,7 @@ */ #include -#include "common.h" +#include "sensor_logs.h" #include #include #include diff --git a/src/server/dbus_util.cpp b/src/server/dbus_util.cpp index 662be73..8f2941a 100755 --- a/src/server/dbus_util.cpp +++ b/src/server/dbus_util.cpp @@ -17,7 +17,7 @@ * */ -#include +#include #include #include diff --git a/src/server/main.cpp b/src/server/main.cpp index 91c8674..28c425e 100755 --- a/src/server/main.cpp +++ b/src/server/main.cpp @@ -18,7 +18,7 @@ */ #include -#include +#include #include #include #include diff --git a/src/server/permission_checker.cpp b/src/server/permission_checker.cpp index dea1763..e06e680 100755 --- a/src/server/permission_checker.cpp +++ b/src/server/permission_checker.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/server/plugins/accel/accel_sensor.cpp b/src/server/plugins/accel/accel_sensor.cpp index 8bd5451..29341b6 100755 --- a/src/server/plugins/accel/accel_sensor.cpp +++ b/src/server/plugins/accel/accel_sensor.cpp @@ -17,7 +17,7 @@ * */ -#include +#include #include #include diff --git a/src/server/plugins/auto_rotation/auto_rotation_alg.cpp b/src/server/plugins/auto_rotation/auto_rotation_alg.cpp index 3663ad3..2f3ee2a 100644 --- a/src/server/plugins/auto_rotation/auto_rotation_alg.cpp +++ b/src/server/plugins/auto_rotation/auto_rotation_alg.cpp @@ -17,7 +17,7 @@ * */ -#include +#include #include auto_rotation_alg::auto_rotation_alg() diff --git a/src/server/plugins/auto_rotation/auto_rotation_alg_emul.cpp b/src/server/plugins/auto_rotation/auto_rotation_alg_emul.cpp index 4c6d542..353a20a 100644 --- a/src/server/plugins/auto_rotation/auto_rotation_alg_emul.cpp +++ b/src/server/plugins/auto_rotation/auto_rotation_alg_emul.cpp @@ -18,8 +18,8 @@ */ #include -#include -#include +#include +#include #include #include #include diff --git a/src/server/plugins/auto_rotation/auto_rotation_sensor.cpp b/src/server/plugins/auto_rotation/auto_rotation_sensor.cpp index 5601fae..9c8c9d9 100755 --- a/src/server/plugins/auto_rotation/auto_rotation_sensor.cpp +++ b/src/server/plugins/auto_rotation/auto_rotation_sensor.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include diff --git a/src/server/plugins/bio_led_red/bio_led_red_sensor.cpp b/src/server/plugins/bio_led_red/bio_led_red_sensor.cpp index 42405b8..b98da86 100755 --- a/src/server/plugins/bio_led_red/bio_led_red_sensor.cpp +++ b/src/server/plugins/bio_led_red/bio_led_red_sensor.cpp @@ -17,7 +17,7 @@ * */ -#include +#include #include #include diff --git a/src/server/plugins/fusion/CMakeLists.txt b/src/server/plugins/fusion/CMakeLists.txt index 4554eae..98d03c2 100755 --- a/src/server/plugins/fusion/CMakeLists.txt +++ b/src/server/plugins/fusion/CMakeLists.txt @@ -5,7 +5,7 @@ SET(SENSOR_NAME fusion_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/client) -include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) +include_directories(${CMAKE_SOURCE_DIR}/src/server/sensor_fusion) FOREACH(flag ${fusion_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/server/plugins/fusion/fusion_sensor.cpp b/src/server/plugins/fusion/fusion_sensor.cpp index bb04436..40099a7 100755 --- a/src/server/plugins/fusion/fusion_sensor.cpp +++ b/src/server/plugins/fusion/fusion_sensor.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/server/plugins/geo/geo_sensor.cpp b/src/server/plugins/geo/geo_sensor.cpp index 7c9f670..39e2578 100755 --- a/src/server/plugins/geo/geo_sensor.cpp +++ b/src/server/plugins/geo/geo_sensor.cpp @@ -17,7 +17,7 @@ * */ -#include +#include #include #include diff --git a/src/server/plugins/gravity/CMakeLists.txt b/src/server/plugins/gravity/CMakeLists.txt index 66bf3fa..e37d2d3 100755 --- a/src/server/plugins/gravity/CMakeLists.txt +++ b/src/server/plugins/gravity/CMakeLists.txt @@ -5,7 +5,7 @@ SET(SENSOR_NAME gravity_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/client) -include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) +include_directories(${CMAKE_SOURCE_DIR}/src/server/sensor_fusion) FOREACH(flag ${gravity_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/server/plugins/gravity/gravity_sensor.cpp b/src/server/plugins/gravity/gravity_sensor.cpp index dfe3ae7..9f1a625 100755 --- a/src/server/plugins/gravity/gravity_sensor.cpp +++ b/src/server/plugins/gravity/gravity_sensor.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/server/plugins/gyro/gyro_sensor.cpp b/src/server/plugins/gyro/gyro_sensor.cpp index aeab006..f9787f1 100755 --- a/src/server/plugins/gyro/gyro_sensor.cpp +++ b/src/server/plugins/gyro/gyro_sensor.cpp @@ -17,7 +17,7 @@ * */ -#include +#include #include #include diff --git a/src/server/plugins/light/light_sensor.cpp b/src/server/plugins/light/light_sensor.cpp index 0b9062e..4c6c6e8 100755 --- a/src/server/plugins/light/light_sensor.cpp +++ b/src/server/plugins/light/light_sensor.cpp @@ -17,7 +17,7 @@ * */ -#include +#include #include #include #include diff --git a/src/server/plugins/linear_accel/CMakeLists.txt b/src/server/plugins/linear_accel/CMakeLists.txt index 586dad0..75eae9d 100755 --- a/src/server/plugins/linear_accel/CMakeLists.txt +++ b/src/server/plugins/linear_accel/CMakeLists.txt @@ -5,7 +5,7 @@ SET(SENSOR_NAME linear_accel_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/client) -include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) +include_directories(${CMAKE_SOURCE_DIR}/src/server/sensor_fusion) FOREACH(flag ${linear_accel_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/server/plugins/linear_accel/linear_accel_sensor.cpp b/src/server/plugins/linear_accel/linear_accel_sensor.cpp index fc2a1bb..87f2dd0 100755 --- a/src/server/plugins/linear_accel/linear_accel_sensor.cpp +++ b/src/server/plugins/linear_accel/linear_accel_sensor.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/server/plugins/orientation/CMakeLists.txt b/src/server/plugins/orientation/CMakeLists.txt index 15a5054..989d597 100755 --- a/src/server/plugins/orientation/CMakeLists.txt +++ b/src/server/plugins/orientation/CMakeLists.txt @@ -5,7 +5,7 @@ SET(SENSOR_NAME orientation_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/client) -include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) +include_directories(${CMAKE_SOURCE_DIR}/src/server/sensor_fusion) FOREACH(flag ${orientation_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/server/plugins/orientation/orientation_sensor.cpp b/src/server/plugins/orientation/orientation_sensor.cpp index e560007..d9e2902 100755 --- a/src/server/plugins/orientation/orientation_sensor.cpp +++ b/src/server/plugins/orientation/orientation_sensor.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/server/plugins/pressure/pressure_sensor.cpp b/src/server/plugins/pressure/pressure_sensor.cpp index 33f3b76..f528883 100755 --- a/src/server/plugins/pressure/pressure_sensor.cpp +++ b/src/server/plugins/pressure/pressure_sensor.cpp @@ -17,7 +17,7 @@ * */ -#include +#include #include #include #include diff --git a/src/server/plugins/proxi/proxi_sensor.cpp b/src/server/plugins/proxi/proxi_sensor.cpp index ab11ee3..fb4c07d 100755 --- a/src/server/plugins/proxi/proxi_sensor.cpp +++ b/src/server/plugins/proxi/proxi_sensor.cpp @@ -17,7 +17,7 @@ * */ -#include +#include #include #include #include diff --git a/src/server/plugins/rotation_vector/gaming_rv/CMakeLists.txt b/src/server/plugins/rotation_vector/gaming_rv/CMakeLists.txt index da5bc7b..a43850f 100755 --- a/src/server/plugins/rotation_vector/gaming_rv/CMakeLists.txt +++ b/src/server/plugins/rotation_vector/gaming_rv/CMakeLists.txt @@ -5,7 +5,7 @@ SET(SENSOR_NAME gaming_rv_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/client) -include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) +include_directories(${CMAKE_SOURCE_DIR}/src/server/sensor_fusion) FOREACH(flag ${gaming_rv_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/server/plugins/rotation_vector/gaming_rv/gaming_rv_sensor.cpp b/src/server/plugins/rotation_vector/gaming_rv/gaming_rv_sensor.cpp index f491038..b2c2209 100755 --- a/src/server/plugins/rotation_vector/gaming_rv/gaming_rv_sensor.cpp +++ b/src/server/plugins/rotation_vector/gaming_rv/gaming_rv_sensor.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/server/plugins/rotation_vector/geomagnetic_rv/CMakeLists.txt b/src/server/plugins/rotation_vector/geomagnetic_rv/CMakeLists.txt index 7055dc7..4c2718d 100755 --- a/src/server/plugins/rotation_vector/geomagnetic_rv/CMakeLists.txt +++ b/src/server/plugins/rotation_vector/geomagnetic_rv/CMakeLists.txt @@ -5,7 +5,7 @@ SET(SENSOR_NAME geomagnetic_rv_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/client) -include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) +include_directories(${CMAKE_SOURCE_DIR}/src/server/sensor_fusion) FOREACH(flag ${geomagnetic_rv_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/server/plugins/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp b/src/server/plugins/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp index f4aafe8..2361718 100755 --- a/src/server/plugins/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp +++ b/src/server/plugins/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/server/plugins/rotation_vector/rv/CMakeLists.txt b/src/server/plugins/rotation_vector/rv/CMakeLists.txt index dd785ff..13759b5 100755 --- a/src/server/plugins/rotation_vector/rv/CMakeLists.txt +++ b/src/server/plugins/rotation_vector/rv/CMakeLists.txt @@ -5,7 +5,7 @@ SET(SENSOR_NAME rv_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/client) -include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) +include_directories(${CMAKE_SOURCE_DIR}/src/server/sensor_fusion) FOREACH(flag ${rv_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/server/plugins/rotation_vector/rv/rv_sensor.cpp b/src/server/plugins/rotation_vector/rv/rv_sensor.cpp index e42716b..df9c18c 100755 --- a/src/server/plugins/rotation_vector/rv/rv_sensor.cpp +++ b/src/server/plugins/rotation_vector/rv/rv_sensor.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/server/plugins/rotation_vector/rv_raw/rv_raw_sensor.cpp b/src/server/plugins/rotation_vector/rv_raw/rv_raw_sensor.cpp index 3b9b09e..6e989e4 100755 --- a/src/server/plugins/rotation_vector/rv_raw/rv_raw_sensor.cpp +++ b/src/server/plugins/rotation_vector/rv_raw/rv_raw_sensor.cpp @@ -17,7 +17,7 @@ * */ -#include +#include #include #include diff --git a/src/server/plugins/temperature/temperature_sensor.cpp b/src/server/plugins/temperature/temperature_sensor.cpp index 679be58..197efda 100755 --- a/src/server/plugins/temperature/temperature_sensor.cpp +++ b/src/server/plugins/temperature/temperature_sensor.cpp @@ -17,7 +17,7 @@ * */ -#include +#include #include #include #include diff --git a/src/server/plugins/tilt/CMakeLists.txt b/src/server/plugins/tilt/CMakeLists.txt index 727727c..5c8312a 100755 --- a/src/server/plugins/tilt/CMakeLists.txt +++ b/src/server/plugins/tilt/CMakeLists.txt @@ -5,7 +5,7 @@ SET(SENSOR_NAME tilt_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/client) -include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) +include_directories(${CMAKE_SOURCE_DIR}/src/server/sensor_fusion) FOREACH(flag ${tilt_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/server/plugins/tilt/tilt_sensor.cpp b/src/server/plugins/tilt/tilt_sensor.cpp index a898dea..918c3c1 100755 --- a/src/server/plugins/tilt/tilt_sensor.cpp +++ b/src/server/plugins/tilt/tilt_sensor.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/server/plugins/ultraviolet/ultraviolet_sensor.cpp b/src/server/plugins/ultraviolet/ultraviolet_sensor.cpp index 0b0cd43..496dd03 100755 --- a/src/server/plugins/ultraviolet/ultraviolet_sensor.cpp +++ b/src/server/plugins/ultraviolet/ultraviolet_sensor.cpp @@ -17,7 +17,7 @@ * */ -#include +#include #include #include diff --git a/src/server/plugins/uncal_gyro/CMakeLists.txt b/src/server/plugins/uncal_gyro/CMakeLists.txt index d983a91..f38b3c9 100644 --- a/src/server/plugins/uncal_gyro/CMakeLists.txt +++ b/src/server/plugins/uncal_gyro/CMakeLists.txt @@ -5,7 +5,7 @@ SET(SENSOR_NAME uncal_gyro_sensor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/client) -include_directories(${CMAKE_SOURCE_DIR}/src/plugins/sensor_fusion) +include_directories(${CMAKE_SOURCE_DIR}/src/server/sensor_fusion) FOREACH(flag ${gravity_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") diff --git a/src/server/plugins/uncal_gyro/uncal_gyro_sensor.cpp b/src/server/plugins/uncal_gyro/uncal_gyro_sensor.cpp index 831b6fe..2d9e60b 100755 --- a/src/server/plugins/uncal_gyro/uncal_gyro_sensor.cpp +++ b/src/server/plugins/uncal_gyro/uncal_gyro_sensor.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/server/sensor_base.h b/src/server/sensor_base.h index 90e27e9..612547a 100644 --- a/src/server/sensor_base.h +++ b/src/server/sensor_base.h @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/shared/sensor_plugin_loader.cpp b/src/server/sensor_plugin_loader.cpp similarity index 99% rename from src/shared/sensor_plugin_loader.cpp rename to src/server/sensor_plugin_loader.cpp index 3b5831c..2c10fd4 100755 --- a/src/shared/sensor_plugin_loader.cpp +++ b/src/server/sensor_plugin_loader.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/shared/sensor_plugin_loader.h b/src/server/sensor_plugin_loader.h similarity index 100% rename from src/shared/sensor_plugin_loader.h rename to src/server/sensor_plugin_loader.h diff --git a/src/server/worker_thread.cpp b/src/server/worker_thread.cpp index d49d381..2726706 100755 --- a/src/server/worker_thread.cpp +++ b/src/server/worker_thread.cpp @@ -17,7 +17,7 @@ * */ -#include +#include #include #include diff --git a/src/shared/CMakeLists.txt b/src/shared/CMakeLists.txt index b11b4b1..41f824f 100644 --- a/src/shared/CMakeLists.txt +++ b/src/shared/CMakeLists.txt @@ -17,76 +17,36 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/client) -add_library(sensord-server SHARED - worker_thread.cpp - cvirtual_sensor_config.cpp - csensor_event_queue.cpp - csensor_event_dispatcher.cpp - csensor_usage.cpp - cclient_info_manager.cpp - cclient_sensor_record.cpp - cplugin_info_list.cpp - sensor_plugin_loader.cpp - sensor_base.cpp - physical_sensor.cpp - virtual_sensor.cpp - iio_common.cpp -) add_library(sensord-share SHARED + cbase_lock.cpp + cmutex.cpp cpacket.cpp csocket.cpp + sensor_logs.cpp sensor_info.cpp ) -target_link_libraries(sensord-server ${shared_pkgs_LDFLAGS} "-lrt -ldl -pthread" "sensord-share") + target_link_libraries(sensord-share ${shared_pkgs_LDFLAGS} "-lrt -ldl -pthread") -configure_file(sensord-server.pc.in ${CMAKE_CURRENT_SOURCE_DIR}/sensord-server.pc @ONLY) + configure_file(${PROJECT_NAME}.pc.in ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc @ONLY) -install(TARGETS sensord-server DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(TARGETS sensord-share DESTINATION ${CMAKE_INSTALL_LIBDIR}) -install(FILES sensord-server.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + install(FILES ${PROJECT_NAME}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) install(FILES - worker_thread.h - cvirtual_sensor_config.h - csensor_event_queue.h - cplugin_info_list.h - sensor_plugin_loader.h - sensor_base.h - physical_sensor.h - virtual_sensor.h cpacket.h csocket.h cbase_lock.h sensor_info.h - iio_common.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} ) -install(FILES sensor_accel.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_geomag.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_light.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_proxi.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_gyro.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_pressure.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_context.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_auto_rotation.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_gravity.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_linear_accel.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_orientation.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_tilt.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_rv.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_geomagnetic_rv.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_gaming_rv.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_temperature.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_motion.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_fusion.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_ultraviolet.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_bio_led_red.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) + install(FILES sensor_deprecated.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) -install(FILES sensor_uncal_gyro.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) +install(FILES sensor_types.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) install(FILES sensor_internal_deprecated.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) install(FILES sensor_internal.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) diff --git a/src/shared/cbase_lock.cpp b/src/shared/cbase_lock.cpp index c4f6107..5a1a639 100755 --- a/src/shared/cbase_lock.cpp +++ b/src/shared/cbase_lock.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/shared/cmutex.cpp b/src/shared/cmutex.cpp index 3ffc9f0..fb09f7c 100755 --- a/src/shared/cmutex.cpp +++ b/src/shared/cmutex.cpp @@ -18,7 +18,7 @@ */ #include -#include "common.h" +#include "sensor_logs.h" cmutex::cmutex() { diff --git a/src/shared/cpacket.cpp b/src/shared/cpacket.cpp index aef8070..8e680b0 100755 --- a/src/shared/cpacket.cpp +++ b/src/shared/cpacket.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/shared/csensor_config.cpp b/src/shared/csensor_config.cpp new file mode 100755 index 0000000..ba8111b --- /dev/null +++ b/src/shared/csensor_config.cpp @@ -0,0 +1,279 @@ +/* + * libsensord-share + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include "sensor_logs.h" +#include +#include +#include +#include +#include +#include + +using std::ifstream; +using std::string; +using std::istringstream; + +#define ROOT_ELEMENT "SENSOR" +#define TEXT_ELEMENT "text" +#define MODEL_ID_ATTR "id" +#define DEFAULT_ATTR "value" + +csensor_config::csensor_config() +{ +} + +csensor_config& csensor_config::get_instance(void) +{ + static bool load_done = false; + static csensor_config inst; + + if (!load_done) { + inst.load_config(SENSOR_CONFIG_FILE_PATH); + inst.get_device_id(); + if (!inst.m_device_id.empty()) + INFO("Device ID = %s", inst.m_device_id.c_str()); + else + ERR("Failed to get Device ID"); + load_done = true; + } + + return inst; +} + +bool csensor_config::load_config(const string& config_path) +{ + xmlDocPtr doc; + xmlNodePtr cur; + + DBG("csensor_config::load_config(\"%s\") is called!\n",config_path.c_str()); + + doc = xmlParseFile(config_path.c_str()); + + if (doc == NULL) { + ERR("There is no %s\n",config_path.c_str()); + return false; + } + + cur = xmlDocGetRootElement(doc); + if(cur == NULL) { + ERR("There is no root element in %s\n",config_path.c_str()); + xmlFreeDoc(doc); + return false; + } + + if(xmlStrcmp(cur->name, (const xmlChar *)ROOT_ELEMENT)) { + ERR("Wrong type document: there is no [%s] root element in %s\n",ROOT_ELEMENT,config_path.c_str()); + xmlFreeDoc(doc); + return false; + } + + xmlNodePtr model_list_node_ptr; + xmlNodePtr model_node_ptr; + xmlNodePtr element_node_ptr; + xmlAttrPtr attr_ptr; + char* prop = NULL; + + model_list_node_ptr = cur->xmlChildrenNode; + + while (model_list_node_ptr != NULL) { + //skip garbage element, [text] + if (!xmlStrcmp(model_list_node_ptr->name,(const xmlChar *)TEXT_ELEMENT)) { + model_list_node_ptr = model_list_node_ptr->next; + continue; + } + + //insert Model_list to config map + m_sensor_config[(const char*)model_list_node_ptr->name]; + DBG("<%s>\n",(const char*)model_list_node_ptr->name); + + model_node_ptr = model_list_node_ptr->xmlChildrenNode; + while (model_node_ptr != NULL){ + //skip garbage element, [text] + if (!xmlStrcmp(model_node_ptr->name,(const xmlChar *)TEXT_ELEMENT)) { + model_node_ptr = model_node_ptr->next; + continue; + } + + + string model_id; + prop = (char*)xmlGetProp(model_node_ptr,(const xmlChar*)MODEL_ID_ATTR); + model_id = prop; + free(prop); + + //insert Model to Model_list + m_sensor_config[(const char*)model_list_node_ptr->name][model_id]; + DBG("<%s id=\"%s\">\n",(const char*)model_list_node_ptr->name,model_id.c_str()); + + element_node_ptr = model_node_ptr->xmlChildrenNode; + while (element_node_ptr != NULL) { + //skip garbage element, [text] + if (!xmlStrcmp(element_node_ptr->name,(const xmlChar *)TEXT_ELEMENT)) { + element_node_ptr = element_node_ptr->next; + continue; + } + + //insert Element to Model + m_sensor_config[(const char*)model_list_node_ptr->name][model_id][(const char*)element_node_ptr->name]; + DBG("<%s id=\"%s\"><%s>\n",(const char*)model_list_node_ptr->name,model_id.c_str(),(const char*)element_node_ptr->name); + + attr_ptr = element_node_ptr->properties; + while (attr_ptr != NULL) { + + string key,value; + key = (char*)attr_ptr->name; + prop = (char*)xmlGetProp(element_node_ptr,attr_ptr->name); + value = prop; + free(prop); + + //insert attribute to Element + m_sensor_config[(const char*)model_list_node_ptr->name][model_id][(const char*)element_node_ptr->name][key]=value; + DBG("<%s id=\"%s\"><%s \"%s\"=\"%s\">\n",(const char*)model_list_node_ptr->name,model_id.c_str(),(const char*)element_node_ptr->name,key.c_str(),value.c_str()); + attr_ptr = attr_ptr->next; + } + + + element_node_ptr = element_node_ptr->next; + } + + DBG("\n"); + model_node_ptr = model_node_ptr->next; + } + + DBG("\n"); + model_list_node_ptr = model_list_node_ptr->next; + } + + xmlFreeDoc(doc); + return true; +} + + +bool csensor_config::get(const string& sensor_type,const string& model_id, const string& element, const string& attr, string& value) +{ + auto it_model_list = m_sensor_config.find(sensor_type); + + if (it_model_list == m_sensor_config.end()) { + ERR("There is no <%s> element\n",sensor_type.c_str()); + return false; + } + + auto it_model = it_model_list->second.find(model_id); + + if (it_model == it_model_list->second.end()) { + ERR("There is no <%s id=\"%s\"> element\n",sensor_type.c_str(),model_id.c_str()); + return false; + } + + auto it_element = it_model->second.find(element); + + if (it_element == it_model->second.end()) { + DBG("There is no <%s id=\"%s\"><%s> element\n",sensor_type.c_str(),model_id.c_str(),element.c_str()); + return false; + } + + auto it_attr = it_element->second.find(attr); + + if (it_attr == it_element->second.end()) { + DBG("There is no <%s id=\"%s\"><%s \"%s\">\n",sensor_type.c_str(),model_id.c_str(),element.c_str(),attr.c_str()); + return false; + } + + value = it_attr->second; + + return true; +} + +bool csensor_config::get(const string& sensor_type, const string& model_id, const string& element, const string& attr, double& value) +{ + string str_value; + + if (get(sensor_type,model_id,element,attr,str_value) == false) + return false; + + istringstream convert(str_value); + + if ( !(convert >> value)) + value = 0; + + return true; +} + +bool csensor_config::get(const string& sensor_type, const string& model_id, const string& element, const string& attr, long& value) +{ + string str_value; + + if (get(sensor_type,model_id,element,attr,str_value) == false) + return false; + + istringstream convert(str_value); + + if ( !(convert >> value)) + value = 0; + + return true; +} + +bool csensor_config::get(const string& sensor_type, const string& model_id, const string& element, string& value) +{ + if (get(sensor_type, model_id, element, m_device_id, value)) + return true; + + if (get(sensor_type, model_id, element, DEFAULT_ATTR, value)) + return true; + + return false; +} + +bool csensor_config::get(const string& sensor_type, const string& model_id, const string& element, double& value) +{ + if (get(sensor_type, model_id, element, m_device_id, value)) + return true; + + if (get(sensor_type, model_id, element, DEFAULT_ATTR, value)) + return true; + + return false; +} + +bool csensor_config::get(const string& sensor_type, const string& model_id, const string& element, long& value) +{ + if (get(sensor_type, model_id, element, m_device_id, value)) + return true; + + if (get(sensor_type, model_id, element, DEFAULT_ATTR, value)) + return true; + + return false; +} + +bool csensor_config::is_supported(const string& sensor_type,const string& model_id) +{ + auto it_model_list = m_sensor_config.find(sensor_type); + + if (it_model_list == m_sensor_config.end()) + return false; + + auto it_model = it_model_list->second.find(model_id); + + if (it_model == it_model_list->second.end()) + return false; + + return true; +} diff --git a/src/shared/csensor_config.h b/src/shared/csensor_config.h new file mode 100755 index 0000000..5ce6c74 --- /dev/null +++ b/src/shared/csensor_config.h @@ -0,0 +1,95 @@ +/* + * libsensord-share + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#if !defined(_CSENSOR_CONFIG_CLASS_H_) +#define _CSENSOR_CONFIG_CLASS_H_ + +#include + +#define SENSOR_CONFIG_FILE_PATH "/usr/etc/sensors.xml" + +typedef std::unordered_map Element; +/* +* an Element is a group of attributes +* +* +* "value" -> "LSM330DLC" +* +*/ + +typedef std::unordered_map Model; +/* +* a Model is a group of elements to consist of specific vendor's one sensor configuration +* +* +* +* +* +* -> +* +*/ + +typedef std::unordered_map Model_list; +/* +* a Model_list is a group of Model +* +* +* +* +* +* "lsm330dlc_accel" -> +* +*/ + +typedef std::unordered_map Sensor_config; +/* +* a SensorConfig represents sensors.xml +* +* +* +* +* "ACCEL" -> Model_list +* +*/ + +class csensor_config : public cconfig +{ +private: + csensor_config(); + csensor_config(csensor_config const&) {}; + csensor_config& operator=(csensor_config const&); + + bool load_config(const std::string& config_path); + + Sensor_config m_sensor_config; +public: + static csensor_config& get_instance(void); + + bool get(const std::string& sensor_type, const std::string& model_id, const std::string& element, const std::string& attr, std::string& value); + bool get(const std::string& sensor_type, const std::string& model_id, const std::string& element, const std::string& attr, double& value); + bool get(const std::string& sensor_type, const std::string& model_id, const std::string& element, const std::string& attr, long& value); + + bool get(const std::string& sensor_type, const std::string& model_id, const std::string& element, std::string& value); + bool get(const std::string& sensor_type, const std::string& model_id, const std::string& element, double& value); + bool get(const std::string& sensor_type, const std::string& model_id, const std::string& element, long& value); + + bool is_supported(const std::string &sensor_type, const std::string &model_id); +}; + +#endif diff --git a/src/shared/csocket.h b/src/shared/csocket.h index c7f719f..9014bc2 100644 --- a/src/shared/csocket.h +++ b/src/shared/csocket.h @@ -26,7 +26,7 @@ #include #include #include -#include "common.h" +#include "sensor_logs.h" class csocket { public: diff --git a/src/shared/sensor_info.cpp b/src/shared/sensor_info.cpp index c80c736..c25f366 100644 --- a/src/shared/sensor_info.cpp +++ b/src/shared/sensor_info.cpp @@ -18,7 +18,7 @@ */ #include -#include +#include #include #include #include diff --git a/src/shared/common.cpp b/src/shared/sensor_logs.cpp similarity index 99% rename from src/shared/common.cpp rename to src/shared/sensor_logs.cpp index 4f9f100..b1b5c0f 100644 --- a/src/shared/common.cpp +++ b/src/shared/sensor_logs.cpp @@ -24,7 +24,7 @@ #include #include #include -#include "common.h" +#include "sensor_logs.h" #include #include #include diff --git a/src/shared/common.h b/src/shared/sensor_logs.h similarity index 100% rename from src/shared/common.h rename to src/shared/sensor_logs.h diff --git a/src/shared/sf_common.h b/src/shared/sf_common.h index 381ac45..af649b9 100644 --- a/src/shared/sf_common.h +++ b/src/shared/sf_common.h @@ -17,7 +17,7 @@ * */ -#include +#include #if !defined(_SF_COMMON_H_) #define _SF_COMMON_H_ -- 2.7.4 From 57f3e3373f246eb8bb1afc33e538d2870230f978 Mon Sep 17 00:00:00 2001 From: Ramasamy Date: Fri, 6 Nov 2015 21:25:08 +0900 Subject: [PATCH 10/16] Fixing Cmakelist and spec issues - Fixing issues in cmake and spec files after restructuring Change-Id: I3a5bb8c74d2af6d24539ead4b7e5c411ca4ca0e3 --- packaging/sensord.spec | 15 ++++----- src/client/CMakeLists.txt | 2 +- src/server/CMakeLists.txt | 39 +++++----------------- src/shared/CMakeLists.txt | 9 ++--- .../{sf_common.pc.in => sensord-devel.pc.in} | 0 5 files changed, 21 insertions(+), 44 deletions(-) rename src/shared/{sf_common.pc.in => sensord-devel.pc.in} (100%) diff --git a/packaging/sensord.spec b/packaging/sensord.spec index ed87346..32c53ac 100644 --- a/packaging/sensord.spec +++ b/packaging/sensord.spec @@ -28,7 +28,7 @@ BuildRequires: pkgconfig(cynara-session) %define geo_state ON %define pressure_state ON %define temperature_state ON -%define ultraviolet_state OFF +%define ultraviolet_state ON %define orientation_state ON %define gravity_state ON %define linear_accel_state ON @@ -37,7 +37,7 @@ BuildRequires: pkgconfig(cynara-session) %define gaming_rv_state ON %define tilt_state ON %define uncal_gyro_state ON -%define bio_led_red_state OFF +%define bio_led_red_state ON %define build_test_suite OFF %description @@ -60,12 +60,12 @@ Requires: %{name} = %{version}-%{release} Sensord library %package -n libsensord-devel -Summary: Sensord library (devel) +Summary: Sensord shared library Group: System/Development Requires: %{name} = %{version}-%{release} %description -n libsensord-devel -Sensord library (devel) +Sensord shared library %if %{build_test_suite} == "ON" %package -n sensor-test @@ -130,17 +130,16 @@ systemctl daemon-reload %manifest libsensord.manifest %{_libdir}/libsensor.so.* %{_libdir}/sensord/*.so* -%{_libdir}/libsensord-share.so -%{_libdir}/libsensord-server.so +%{_libdir}/libsensord-devel.so %license LICENSE.APLv2 %files -n libsensord-devel %defattr(-,root,root,-) %{_includedir}/sensor/*.h -%{_includedir}/sf_common/*.h +%{_includedir}/sensord-devel/*.h %{_libdir}/libsensor.so %{_libdir}/pkgconfig/sensor.pc -%{_libdir}/pkgconfig/sf_common.pc +%{_libdir}/pkgconfig/sensord-devel.pc %{_libdir}/pkgconfig/sensord-server.pc %license LICENSE.APLv2 diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index 3f989c8..edc1f1d 100755 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -29,7 +29,7 @@ add_library(${PROJECT_NAME} SHARED poller.cpp ) -target_link_libraries(${PROJECT_NAME} ${lib_pkgs_LDFLAGS} "sensord-share") +target_link_libraries(${PROJECT_NAME} ${lib_pkgs_LDFLAGS} "sensord-devel") SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR}) SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION}) diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt index f751ecc..7cbdbf9 100755 --- a/src/server/CMakeLists.txt +++ b/src/server/CMakeLists.txt @@ -3,6 +3,10 @@ project(sensord CXX) INCLUDE(FindPkgConfig) PKG_CHECK_MODULES(server_pkgs REQUIRED glib-2.0 gio-2.0 dlog libsystemd-daemon libxml-2.0 cynara-client cynara-creds-socket cynara-session) + +INCLUDE_DIRECTORIES(include) +FILE(GLOB SERVER_SRCS *.c *.cpp) + FOREACH(flag ${server_pkgs_LDFLAGS}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") ENDFOREACH(flag) @@ -13,46 +17,19 @@ ENDFOREACH(flag) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/client) +include_directories(${CMAKE_SOURCE_DIR}/src/shared) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lrt -ldl -pthread -fPIE") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie") -SET(SERVER_SRCS - dbus_util.cpp - server.cpp - command_worker.cpp - permission_checker.cpp - main.cpp +add_executable(${PROJECT_NAME} ${SERVER_SRCS}) -) +target_link_libraries(${PROJECT_NAME} ${lib_pkgs_LDFLAGS} "sensord-devel") -add_library(sensord-server SHARED - worker_thread.cpp - cvirtual_sensor_config.cpp - csensor_event_queue.cpp - csensor_event_dispatcher.cpp - csensor_usage.cpp - cplugin_info_list.cpp - sensor_plugin_loader.cpp - sensor_base.cpp - physical_sensor.cpp - virtual_sensor.cpp - cclient_info_manager.cpp - cclient_sensor_record.cpp - cconfig.cpp -) -target_link_libraries(sensord-server ${shared_pkgs_LDFLAGS} "-lrt -ldl -pthread" "sensord-share") configure_file(sensord-server.pc.in ${CMAKE_CURRENT_SOURCE_DIR}/sensord-server.pc @ONLY) -install(TARGETS sensord-server DESTINATION ${CMAKE_INSTALL_LIBDIR}) -install(FILES sensord-server.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) - -add_executable(${PROJECT_NAME} ${SERVER_SRCS}) - -target_link_libraries(${PROJECT_NAME} ${server_pkgs_LDFLAGS} "sensord-server") install(TARGETS ${PROJECT_NAME} DESTINATION bin) - - +install(FILES sensord-server.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) IF("${ACCEL}" STREQUAL "ON") add_subdirectory(plugins/accel) diff --git a/src/shared/CMakeLists.txt b/src/shared/CMakeLists.txt index 41f824f..a44bce0 100644 --- a/src/shared/CMakeLists.txt +++ b/src/shared/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.6) -project(sf_common CXX) +project(sensord-devel CXX) INCLUDE(FindPkgConfig) PKG_CHECK_MODULES(shared_pkgs REQUIRED dlog libxml-2.0) @@ -18,7 +18,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/client) -add_library(sensord-share SHARED +add_library(${PROJECT_NAME} SHARED cbase_lock.cpp cmutex.cpp cpacket.cpp @@ -28,12 +28,12 @@ add_library(sensord-share SHARED ) -target_link_libraries(sensord-share ${shared_pkgs_LDFLAGS} "-lrt -ldl -pthread") +target_link_libraries(${PROJECT_NAME} ${shared_pkgs_LDFLAGS} "-lrt -ldl -pthread") configure_file(${PROJECT_NAME}.pc.in ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc @ONLY) -install(TARGETS sensord-share DESTINATION ${CMAKE_INSTALL_LIBDIR}) +install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(FILES ${PROJECT_NAME}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) install(FILES @@ -49,4 +49,5 @@ install(FILES sensor_deprecated.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor install(FILES sensor_types.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) install(FILES sensor_internal_deprecated.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) install(FILES sensor_internal.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) +install(FILES sensor_common.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) diff --git a/src/shared/sf_common.pc.in b/src/shared/sensord-devel.pc.in similarity index 100% rename from src/shared/sf_common.pc.in rename to src/shared/sensord-devel.pc.in -- 2.7.4 From 4fc2f4bdb07547f38f4d298fc7a95c39c1d3bf27 Mon Sep 17 00:00:00 2001 From: Ramasamy Date: Tue, 10 Nov 2015 18:40:39 +0900 Subject: [PATCH 11/16] Refactoring sensord build files - Refactoring all cmake and spec files. - single library for all sensord-plugins - updated plugin loader for single sensord-plugins and hal-plugins lib - moving pressure sensor config to sensor-hal - adding separate library for sensord-plugins Change-Id: I9333be215387a4d4fcd7b6a4cbdb7206c4a88bdf --- CMakeLists.txt | 3 - packaging/sensord.spec | 17 +- sensor_plugins.xml.in | 35 --- src/server/CMakeLists.txt | 88 +------ src/server/plugins/CMakeLists.txt | 158 ++++++++++++ src/server/plugins/accel/CMakeLists.txt | 23 -- src/server/plugins/accel/accel_sensor.cpp | 18 -- src/server/plugins/auto_rotation/CMakeLists.txt | 25 -- .../plugins/auto_rotation/auto_rotation_sensor.cpp | 18 -- src/server/plugins/bio_led_red/CMakeLists.txt | 23 -- .../plugins/bio_led_red/bio_led_red_sensor.cpp | 18 -- src/server/plugins/fusion/CMakeLists.txt | 24 -- src/server/plugins/fusion/fusion_sensor.cpp | 25 -- src/server/plugins/geo/CMakeLists.txt | 23 -- src/server/plugins/geo/geo_sensor.cpp | 18 -- src/server/plugins/gravity/CMakeLists.txt | 24 -- src/server/plugins/gravity/gravity_sensor.cpp | 18 -- src/server/plugins/gyro/CMakeLists.txt | 23 -- src/server/plugins/gyro/gyro_sensor.cpp | 18 -- src/server/plugins/light/CMakeLists.txt | 23 -- src/server/plugins/light/light_sensor.cpp | 18 -- src/server/plugins/linear_accel/CMakeLists.txt | 24 -- .../plugins/linear_accel/linear_accel_sensor.cpp | 17 -- src/server/plugins/orientation/CMakeLists.txt | 24 -- .../plugins/orientation/orientation_sensor.cpp | 17 -- src/server/plugins/pressure/CMakeLists.txt | 23 -- src/server/plugins/pressure/pressure_sensor.cpp | 75 +----- src/server/plugins/pressure/pressure_sensor.h | 6 +- src/server/plugins/proxi/CMakeLists.txt | 23 -- src/server/plugins/proxi/proxi_sensor.cpp | 17 -- src/server/plugins/rotation_vector/CMakeLists.txt | 9 - .../rotation_vector/gaming_rv/CMakeLists.txt | 24 -- .../rotation_vector/gaming_rv/gaming_rv_sensor.cpp | 24 -- .../rotation_vector/geomagnetic_rv/CMakeLists.txt | 24 -- .../geomagnetic_rv/geomagnetic_rv_sensor.cpp | 18 -- .../plugins/rotation_vector/rv/CMakeLists.txt | 24 -- .../plugins/rotation_vector/rv/rv_sensor.cpp | 24 -- .../plugins/rotation_vector/rv_raw/CMakeLists.txt | 26 -- .../rotation_vector/rv_raw/rv_raw_sensor.cpp | 18 -- .../data/100ms/gravity/single_roll_throw/accel.txt | 0 .../data/100ms/gravity/single_roll_throw/gyro.txt | 0 .../100ms/gravity/single_roll_throw/magnetic.txt | 0 .../100ms/linear_acceleration/move_x_y_z/accel.txt | 0 .../100ms/linear_acceleration/move_x_y_z/gyro.txt | 0 .../linear_acceleration/move_x_y_z/magnetic.txt | 0 .../100ms/orientation/roll_pitch_yaw/accel.txt | 0 .../data/100ms/orientation/roll_pitch_yaw/gyro.txt | 0 .../100ms/orientation/roll_pitch_yaw/magnetic.txt | 0 .../data/25ms/pedo/Climb_stairs_down/In_hand/accel | 0 .../data/25ms/pedo/Climb_stairs_down/In_hand/gyro | 0 .../25ms/pedo/Climb_stairs_down/In_hand/magnetic | 0 .../25ms/pedo/Climb_stairs_down/Pant_pocket/accel | 0 .../25ms/pedo/Climb_stairs_down/Pant_pocket/gyro | 0 .../pedo/Climb_stairs_down/Pant_pocket/magnetic | 0 .../25ms/pedo/Climb_stairs_down/Shirt_pocket/accel | 0 .../25ms/pedo/Climb_stairs_down/Shirt_pocket/gyro | 0 .../pedo/Climb_stairs_down/Shirt_pocket/magnetic | 0 .../pedo/Climb_stairs_down/While_talking/accel | 0 .../25ms/pedo/Climb_stairs_down/While_talking/gyro | 0 .../pedo/Climb_stairs_down/While_talking/magnetic | 0 .../data/25ms/pedo/Climb_stairs_up/In_hand/accel | 0 .../data/25ms/pedo/Climb_stairs_up/In_hand/gyro | 0 .../25ms/pedo/Climb_stairs_up/In_hand/magnetic | 0 .../25ms/pedo/Climb_stairs_up/Pant_pocket/accel | 0 .../25ms/pedo/Climb_stairs_up/Pant_pocket/gyro | 0 .../25ms/pedo/Climb_stairs_up/Pant_pocket/magnetic | 0 .../25ms/pedo/Climb_stairs_up/Shirt_pocket/accel | 0 .../25ms/pedo/Climb_stairs_up/Shirt_pocket/gyro | 0 .../pedo/Climb_stairs_up/Shirt_pocket/magnetic | 0 .../25ms/pedo/Climb_stairs_up/While_talking/accel | 0 .../25ms/pedo/Climb_stairs_up/While_talking/gyro | 0 .../pedo/Climb_stairs_up/While_talking/magnetic | 0 .../design/data/25ms/pedo/Walk_fast/In_hand/accel | 0 .../design/data/25ms/pedo/Walk_fast/In_hand/gyro | 0 .../data/25ms/pedo/Walk_fast/In_hand/magnetic | 0 .../data/25ms/pedo/Walk_fast/Pant_pocket/accel | 0 .../data/25ms/pedo/Walk_fast/Pant_pocket/gyro | 0 .../data/25ms/pedo/Walk_fast/Pant_pocket/magnetic | 0 .../data/25ms/pedo/Walk_fast/Shirt_pocket/accel | 0 .../data/25ms/pedo/Walk_fast/Shirt_pocket/gyro | 0 .../data/25ms/pedo/Walk_fast/Shirt_pocket/magnetic | 0 .../data/25ms/pedo/Walk_fast/While_talking/accel | 0 .../data/25ms/pedo/Walk_fast/While_talking/gyro | 0 .../25ms/pedo/Walk_fast/While_talking/magnetic | 0 .../design/data/25ms/pedo/Walk_slow/In_hand/accel | 0 .../design/data/25ms/pedo/Walk_slow/In_hand/gyro | 0 .../data/25ms/pedo/Walk_slow/In_hand/magnetic | 0 .../data/25ms/pedo/Walk_slow/Pant_pocket/accel | 0 .../data/25ms/pedo/Walk_slow/Pant_pocket/gyro | 0 .../data/25ms/pedo/Walk_slow/Pant_pocket/magnetic | 0 .../data/25ms/pedo/Walk_slow/Shirt_pocket/accel | 0 .../data/25ms/pedo/Walk_slow/Shirt_pocket/gyro | 0 .../data/25ms/pedo/Walk_slow/Shirt_pocket/magnetic | 0 .../data/25ms/pedo/Walk_slow/While_talking/accel | 0 .../data/25ms/pedo/Walk_slow/While_talking/gyro | 0 .../25ms/pedo/Walk_slow/While_talking/magnetic | 0 ...ock_diagram_gravity_and_linear_acceleration.png | Bin .../block_diagram_orientation_estimation.png | Bin .../documentation/diagram/device_orientation.png | Bin .../documentation/diagram/kalman_filter_stages.png | Bin .../diagram/orientation_effect_on_gravity.png | Bin .../projection_diagram_gravity_computation.png | Bin .../design/documentation/equation/equation_1.png | Bin .../design/documentation/equation/equation_10.png | Bin .../design/documentation/equation/equation_11.png | Bin .../design/documentation/equation/equation_12.png | Bin .../design/documentation/equation/equation_13.png | Bin .../documentation/equation/equation_13_updated.png | Bin .../design/documentation/equation/equation_14.png | Bin .../design/documentation/equation/equation_15.png | Bin .../design/documentation/equation/equation_16.png | Bin .../design/documentation/equation/equation_17.png | Bin .../design/documentation/equation/equation_18.png | Bin .../design/documentation/equation/equation_19.png | Bin .../design/documentation/equation/equation_2.png | Bin .../design/documentation/equation/equation_20.png | Bin .../design/documentation/equation/equation_21.png | Bin .../design/documentation/equation/equation_22.png | Bin .../design/documentation/equation/equation_23.png | Bin .../design/documentation/equation/equation_24.png | Bin .../design/documentation/equation/equation_25.png | Bin .../design/documentation/equation/equation_26.png | Bin .../design/documentation/equation/equation_27.png | Bin .../design/documentation/equation/equation_28.png | Bin .../design/documentation/equation/equation_29.png | Bin .../design/documentation/equation/equation_3.png | Bin .../design/documentation/equation/equation_30.png | Bin .../design/documentation/equation/equation_31.png | Bin .../design/documentation/equation/equation_32.png | Bin .../design/documentation/equation/equation_33.png | Bin .../design/documentation/equation/equation_34.png | Bin .../design/documentation/equation/equation_35.png | Bin .../design/documentation/equation/equation_36.png | Bin .../design/documentation/equation/equation_37.png | Bin .../design/documentation/equation/equation_38.png | Bin .../design/documentation/equation/equation_39.png | Bin .../design/documentation/equation/equation_4.png | Bin .../design/documentation/equation/equation_40.png | Bin .../design/documentation/equation/equation_5.png | Bin .../design/documentation/equation/equation_6.png | Bin .../design/documentation/equation/equation_7.png | Bin .../design/documentation/equation/equation_8.png | Bin .../design/documentation/equation/equation_9.png | Bin .../design/documentation/sensor_fusion.htm | 0 .../sensor_fusion/design/lib/axis_rot2quat.m | 0 .../sensor_fusion/design/lib/estimate_gaming_rv.m | 0 .../design/lib/estimate_geomagnetic_rv.m | 0 .../sensor_fusion/design/lib/estimate_gravity.m | 0 .../design/lib/estimate_linear_acceleration.m | 0 .../design/lib/estimate_orientation.m | 0 .../sensor_fusion/design/lib/euler2quat.m | 0 .../sensor_fusion/design/lib/quat2euler.m | 0 .../sensor_fusion/design/lib/quat2rot_mat.m | 0 .../sensor_fusion/design/lib/quat_prod.m | 0 .../sensor_fusion/design/lib/rot_mat2quat.m | 0 .../sensor_fusion/design/lib/sf_pedometer.m | 0 .../{ => plugins}/sensor_fusion/design/readme | 0 .../sensor_fusion/design/sf_gaming_rv.m | 0 .../sensor_fusion/design/sf_geomagnetic_rv.m | 0 .../sensor_fusion/design/sf_gravity.m | 0 .../sensor_fusion/design/sf_linear_acceleration.m | 0 .../sensor_fusion/design/sf_orientation.m | 0 .../{ => plugins}/sensor_fusion/euler_angles.cpp | 0 .../{ => plugins}/sensor_fusion/euler_angles.h | 0 src/server/{ => plugins}/sensor_fusion/matrix.cpp | 0 src/server/{ => plugins}/sensor_fusion/matrix.h | 0 .../sensor_fusion/orientation_filter.cpp | 0 .../sensor_fusion/orientation_filter.h | 0 .../{ => plugins}/sensor_fusion/quaternion.cpp | 0 .../{ => plugins}/sensor_fusion/quaternion.h | 0 .../sensor_fusion/rotation_matrix.cpp | 0 .../{ => plugins}/sensor_fusion/rotation_matrix.h | 0 .../{ => plugins}/sensor_fusion/sensor_data.cpp | 8 + .../{ => plugins}/sensor_fusion/sensor_data.h | 3 + .../sensor_fusion/test/gravity_sensor.cpp | 0 .../sensor_fusion/test/gravity_sensor.h | 0 .../test/linear_acceleration_sensor.cpp | 0 .../test/linear_acceleration_sensor.h | 0 .../sensor_fusion/test/orientation_sensor.cpp | 9 - .../sensor_fusion/test/orientation_sensor.h | 0 .../test/test_projects/euler_angles_test/.cproject | 0 .../test/test_projects/euler_angles_test/.project | 0 .../euler_angles_test/euler_angles_main.cpp | 0 .../test_projects/gravity_sensor_test/.cproject | 0 .../test_projects/gravity_sensor_test/.project | 0 .../gravity_sensor_test/gravity_sensor_main.cpp | 0 .../linear_acceleration_sensor_test/.cproject | 0 .../linear_acceleration_sensor_test/.project | 0 .../linear_acceleration_sensor_main.cpp | 0 .../test/test_projects/matrix_test/.cproject | 0 .../test/test_projects/matrix_test/.project | 0 .../test/test_projects/matrix_test/matrix_main.cpp | 0 .../orientation_sensor_test/.cproject | 0 .../test_projects/orientation_sensor_test/.project | 0 .../orientation_sensor_main.cpp | 0 .../test/test_projects/quaternion_test/.cproject | 0 .../test/test_projects/quaternion_test/.project | 0 .../quaternion_test/quaternion_main.cpp | 0 .../test_projects/rotation_matrix_test/.cproject | 0 .../test_projects/rotation_matrix_test/.project | 0 .../rotation_matrix_test/rotation_matrix_main.cpp | 0 .../test/test_projects/sensor_data_test/.cproject | 0 .../test/test_projects/sensor_data_test/.project | 0 .../sensor_data_test/sensor_data_main.cpp | 0 .../test/test_projects/vector_test/.cproject | 0 .../test/test_projects/vector_test/.project | 0 .../test/test_projects/vector_test/vector_main.cpp | 0 src/server/{ => plugins}/sensor_fusion/vector.cpp | 0 src/server/{ => plugins}/sensor_fusion/vector.h | 0 src/server/plugins/sensor_module_create.cpp.in | 285 +++++++++++++++++++++ src/server/plugins/temperature/CMakeLists.txt | 26 -- .../plugins/temperature/temperature_sensor.cpp | 18 -- src/server/plugins/tilt/CMakeLists.txt | 24 -- src/server/plugins/tilt/tilt_sensor.cpp | 18 -- src/server/plugins/ultraviolet/CMakeLists.txt | 23 -- .../plugins/ultraviolet/ultraviolet_sensor.cpp | 18 -- src/server/plugins/uncal_gyro/CMakeLists.txt | 24 -- .../plugins/uncal_gyro/uncal_gyro_sensor.cpp | 18 -- src/server/sensor_fusion/CMakeLists.txt | 35 --- src/server/sensor_plugin_loader.cpp | 156 +---------- src/server/sensor_plugin_loader.h | 2 - src/shared/csensor_config.cpp | 279 -------------------- src/shared/csensor_config.h | 95 ------- test/CMakeLists.txt | 2 +- 224 files changed, 478 insertions(+), 1622 deletions(-) delete mode 100755 sensor_plugins.xml.in create mode 100755 src/server/plugins/CMakeLists.txt delete mode 100755 src/server/plugins/accel/CMakeLists.txt delete mode 100644 src/server/plugins/auto_rotation/CMakeLists.txt delete mode 100644 src/server/plugins/bio_led_red/CMakeLists.txt delete mode 100755 src/server/plugins/fusion/CMakeLists.txt delete mode 100755 src/server/plugins/geo/CMakeLists.txt delete mode 100755 src/server/plugins/gravity/CMakeLists.txt delete mode 100755 src/server/plugins/gyro/CMakeLists.txt delete mode 100755 src/server/plugins/light/CMakeLists.txt delete mode 100755 src/server/plugins/linear_accel/CMakeLists.txt delete mode 100755 src/server/plugins/orientation/CMakeLists.txt delete mode 100755 src/server/plugins/pressure/CMakeLists.txt delete mode 100755 src/server/plugins/proxi/CMakeLists.txt delete mode 100644 src/server/plugins/rotation_vector/CMakeLists.txt delete mode 100755 src/server/plugins/rotation_vector/gaming_rv/CMakeLists.txt delete mode 100755 src/server/plugins/rotation_vector/geomagnetic_rv/CMakeLists.txt delete mode 100755 src/server/plugins/rotation_vector/rv/CMakeLists.txt delete mode 100755 src/server/plugins/rotation_vector/rv_raw/CMakeLists.txt rename src/server/{ => plugins}/sensor_fusion/design/data/100ms/gravity/single_roll_throw/accel.txt (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/100ms/gravity/single_roll_throw/gyro.txt (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/100ms/gravity/single_roll_throw/magnetic.txt (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/accel.txt (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/gyro.txt (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/magnetic.txt (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/accel.txt (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/gyro.txt (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/magnetic.txt (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/accel (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/gyro (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/magnetic (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/accel (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/gyro (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/magnetic (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/accel (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/gyro (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/magnetic (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/accel (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/gyro (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/magnetic (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/accel (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/gyro (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/magnetic (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/accel (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/gyro (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/magnetic (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/accel (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/gyro (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/magnetic (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/accel (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/gyro (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/magnetic (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/accel (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/gyro (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/magnetic (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/accel (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/gyro (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/magnetic (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/accel (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/gyro (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/magnetic (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/accel (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/gyro (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/magnetic (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/accel (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/gyro (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/magnetic (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/accel (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/gyro (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/magnetic (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/accel (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/gyro (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/magnetic (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/accel (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/gyro (100%) rename src/server/{ => plugins}/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/magnetic (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/diagram/block_diagram_gravity_and_linear_acceleration.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/diagram/block_diagram_orientation_estimation.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/diagram/device_orientation.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/diagram/kalman_filter_stages.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/diagram/orientation_effect_on_gravity.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/diagram/projection_diagram_gravity_computation.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_1.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_10.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_11.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_12.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_13.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_13_updated.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_14.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_15.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_16.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_17.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_18.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_19.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_2.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_20.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_21.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_22.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_23.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_24.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_25.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_26.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_27.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_28.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_29.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_3.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_30.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_31.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_32.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_33.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_34.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_35.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_36.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_37.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_38.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_39.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_4.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_40.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_5.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_6.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_7.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_8.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/equation/equation_9.png (100%) rename src/server/{ => plugins}/sensor_fusion/design/documentation/sensor_fusion.htm (100%) rename src/server/{ => plugins}/sensor_fusion/design/lib/axis_rot2quat.m (100%) rename src/server/{ => plugins}/sensor_fusion/design/lib/estimate_gaming_rv.m (100%) rename src/server/{ => plugins}/sensor_fusion/design/lib/estimate_geomagnetic_rv.m (100%) rename src/server/{ => plugins}/sensor_fusion/design/lib/estimate_gravity.m (100%) rename src/server/{ => plugins}/sensor_fusion/design/lib/estimate_linear_acceleration.m (100%) rename src/server/{ => plugins}/sensor_fusion/design/lib/estimate_orientation.m (100%) rename src/server/{ => plugins}/sensor_fusion/design/lib/euler2quat.m (100%) rename src/server/{ => plugins}/sensor_fusion/design/lib/quat2euler.m (100%) rename src/server/{ => plugins}/sensor_fusion/design/lib/quat2rot_mat.m (100%) rename src/server/{ => plugins}/sensor_fusion/design/lib/quat_prod.m (100%) rename src/server/{ => plugins}/sensor_fusion/design/lib/rot_mat2quat.m (100%) rename src/server/{ => plugins}/sensor_fusion/design/lib/sf_pedometer.m (100%) rename src/server/{ => plugins}/sensor_fusion/design/readme (100%) rename src/server/{ => plugins}/sensor_fusion/design/sf_gaming_rv.m (100%) rename src/server/{ => plugins}/sensor_fusion/design/sf_geomagnetic_rv.m (100%) rename src/server/{ => plugins}/sensor_fusion/design/sf_gravity.m (100%) rename src/server/{ => plugins}/sensor_fusion/design/sf_linear_acceleration.m (100%) rename src/server/{ => plugins}/sensor_fusion/design/sf_orientation.m (100%) rename src/server/{ => plugins}/sensor_fusion/euler_angles.cpp (100%) rename src/server/{ => plugins}/sensor_fusion/euler_angles.h (100%) rename src/server/{ => plugins}/sensor_fusion/matrix.cpp (100%) rename src/server/{ => plugins}/sensor_fusion/matrix.h (100%) rename src/server/{ => plugins}/sensor_fusion/orientation_filter.cpp (100%) rename src/server/{ => plugins}/sensor_fusion/orientation_filter.h (100%) rename src/server/{ => plugins}/sensor_fusion/quaternion.cpp (100%) rename src/server/{ => plugins}/sensor_fusion/quaternion.h (100%) rename src/server/{ => plugins}/sensor_fusion/rotation_matrix.cpp (100%) rename src/server/{ => plugins}/sensor_fusion/rotation_matrix.h (100%) rename src/server/{ => plugins}/sensor_fusion/sensor_data.cpp (89%) rename src/server/{ => plugins}/sensor_fusion/sensor_data.h (92%) rename src/server/{ => plugins}/sensor_fusion/test/gravity_sensor.cpp (100%) rename src/server/{ => plugins}/sensor_fusion/test/gravity_sensor.h (100%) rename src/server/{ => plugins}/sensor_fusion/test/linear_acceleration_sensor.cpp (100%) rename src/server/{ => plugins}/sensor_fusion/test/linear_acceleration_sensor.h (100%) rename src/server/{ => plugins}/sensor_fusion/test/orientation_sensor.cpp (80%) rename src/server/{ => plugins}/sensor_fusion/test/orientation_sensor.h (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/euler_angles_test/.cproject (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/euler_angles_test/.project (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/euler_angles_test/euler_angles_main.cpp (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/gravity_sensor_test/.cproject (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/gravity_sensor_test/.project (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/gravity_sensor_test/gravity_sensor_main.cpp (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.cproject (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.project (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/linear_acceleration_sensor_main.cpp (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/matrix_test/.cproject (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/matrix_test/.project (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/matrix_test/matrix_main.cpp (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/orientation_sensor_test/.cproject (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/orientation_sensor_test/.project (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/orientation_sensor_test/orientation_sensor_main.cpp (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/quaternion_test/.cproject (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/quaternion_test/.project (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/quaternion_test/quaternion_main.cpp (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/rotation_matrix_test/.cproject (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/rotation_matrix_test/.project (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/rotation_matrix_test/rotation_matrix_main.cpp (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/sensor_data_test/.cproject (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/sensor_data_test/.project (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/sensor_data_test/sensor_data_main.cpp (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/vector_test/.cproject (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/vector_test/.project (100%) rename src/server/{ => plugins}/sensor_fusion/test/test_projects/vector_test/vector_main.cpp (100%) rename src/server/{ => plugins}/sensor_fusion/vector.cpp (100%) rename src/server/{ => plugins}/sensor_fusion/vector.h (100%) create mode 100644 src/server/plugins/sensor_module_create.cpp.in delete mode 100755 src/server/plugins/temperature/CMakeLists.txt delete mode 100755 src/server/plugins/tilt/CMakeLists.txt delete mode 100644 src/server/plugins/ultraviolet/CMakeLists.txt delete mode 100644 src/server/plugins/uncal_gyro/CMakeLists.txt delete mode 100755 src/server/sensor_fusion/CMakeLists.txt mode change 100755 => 100644 src/server/sensor_plugin_loader.cpp delete mode 100755 src/shared/csensor_config.cpp delete mode 100755 src/shared/csensor_config.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 20079c1..083e2e2 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,9 +23,6 @@ add_definitions(-DLIBDIR="${CMAKE_INSTALL_LIBDIR}") #add_definitions(-Wall -g -D_DEBUG) # Installing files -CONFIGURE_FILE(sensor_plugins.xml.in sensor_plugins.xml @ONLY) - -INSTALL(FILES sensor_plugins.xml DESTINATION etc) INSTALL(FILES virtual_sensors.xml virtual_sensors.xml DESTINATION etc) # Sub-directory diff --git a/packaging/sensord.spec b/packaging/sensord.spec index 32c53ac..c4ff15f 100644 --- a/packaging/sensord.spec +++ b/packaging/sensord.spec @@ -38,7 +38,7 @@ BuildRequires: pkgconfig(cynara-session) %define tilt_state ON %define uncal_gyro_state ON %define bio_led_red_state ON -%define build_test_suite OFF +%define build_test_suite ON %description Sensor daemon @@ -67,6 +67,14 @@ Requires: %{name} = %{version}-%{release} %description -n libsensord-devel Sensord shared library +%package -n libsensord-plugin +Summary: Sensord plugin library +Group: System/Development +Requires: %{name} = %{version}-%{release} + +%description -n libsensord-plugin +Sensord plugin library + %if %{build_test_suite} == "ON" %package -n sensor-test Summary: Sensord library @@ -115,7 +123,6 @@ systemctl daemon-reload %postun -n libsensord -p /sbin/ldconfig %files -n sensord -%attr(0644,root,root)/usr/etc/sensor_plugins.xml %attr(0644,root,root)/usr/etc/virtual_sensors.xml %manifest sensord.manifest %{_bindir}/sensord @@ -129,7 +136,6 @@ systemctl daemon-reload %defattr(-,root,root,-) %manifest libsensord.manifest %{_libdir}/libsensor.so.* -%{_libdir}/sensord/*.so* %{_libdir}/libsensord-devel.so %license LICENSE.APLv2 @@ -143,6 +149,11 @@ systemctl daemon-reload %{_libdir}/pkgconfig/sensord-server.pc %license LICENSE.APLv2 +%files -n libsensord-plugin +%defattr(-,root,root,-) +%{_libdir}/libsensord-plugin.so +%license LICENSE.APLv2 + %if %{build_test_suite} == "ON" %files -n sensor-test %defattr(-,root,root,-) diff --git a/sensor_plugins.xml.in b/sensor_plugins.xml.in deleted file mode 100755 index 603b0a9..0000000 --- a/sensor_plugins.xml.in +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt index 7cbdbf9..051527f 100755 --- a/src/server/CMakeLists.txt +++ b/src/server/CMakeLists.txt @@ -4,6 +4,8 @@ project(sensord CXX) INCLUDE(FindPkgConfig) PKG_CHECK_MODULES(server_pkgs REQUIRED glib-2.0 gio-2.0 dlog libsystemd-daemon libxml-2.0 cynara-client cynara-creds-socket cynara-session) +add_subdirectory(plugins) + INCLUDE_DIRECTORIES(include) FILE(GLOB SERVER_SRCS *.c *.cpp) @@ -24,93 +26,9 @@ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie") add_executable(${PROJECT_NAME} ${SERVER_SRCS}) -target_link_libraries(${PROJECT_NAME} ${lib_pkgs_LDFLAGS} "sensord-devel") +target_link_libraries(${PROJECT_NAME} ${lib_pkgs_LDFLAGS} "sensord-plugin" "sensord-devel") configure_file(sensord-server.pc.in ${CMAKE_CURRENT_SOURCE_DIR}/sensord-server.pc @ONLY) install(TARGETS ${PROJECT_NAME} DESTINATION bin) install(FILES sensord-server.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) - -IF("${ACCEL}" STREQUAL "ON") -add_subdirectory(plugins/accel) -ENDIF() -IF("${GYRO}" STREQUAL "ON") -add_subdirectory(plugins/gyro) -ENDIF() -IF("${PROXI}" STREQUAL "ON") -add_subdirectory(plugins/proxi) -ENDIF() -IF("${LIGHT}" STREQUAL "ON") -add_subdirectory(plugins/light) -ENDIF() -IF("${GEO}" STREQUAL "ON") -add_subdirectory(plugins/geo) -ENDIF() -IF("${AUTO_ROTATION}" STREQUAL "ON") -add_subdirectory(plugins/auto_rotation) -ENDIF() -IF("${PRESSURE}" STREQUAL "ON") -add_subdirectory(plugins/pressure) -ENDIF() -IF("${TEMPERATURE}" STREQUAL "ON") -add_subdirectory(plugins/temperature) -ENDIF() -IF("${HUMIDITY}" STREQUAL "ON") -add_subdirectory(humidity) -ENDIF() -IF("${ULTRAVIOLET}" STREQUAL "ON") -add_subdirectory(plugins/ultraviolet) -ENDIF() -IF("${BIO_LED_RED}" STREQUAL "ON") -add_subdirectory(plugins/bio_led_red) -ENDIF() -IF("${ORIENTATION}" STREQUAL "ON") -set(SENSOR_FUSION_ENABLE "1") -set(ORIENTATION_ENABLE "1") -ENDIF() -IF("${GEOMAGNETIC_RV}" STREQUAL "ON") -set(SENSOR_FUSION_ENABLE "1") -ENDIF() -IF("${GAMING_RV}" STREQUAL "ON") -set(SENSOR_FUSION_ENABLE "1") -ENDIF() -IF("${TILT}" STREQUAL "ON") -set(SENSOR_FUSION_ENABLE "1") -set(TILT_ENABLE "1") -ENDIF() -IF("${UNCAL_GYRO}" STREQUAL "ON") -set(SENSOR_FUSION_ENABLE "1") -set(UNCAL_GYRO_ENABLE "1") -ENDIF() -IF("${GRAVITY}" STREQUAL "ON") -set(SENSOR_FUSION_ENABLE "1") -set(ORIENTATION_ENABLE "1") -set(GRAVITY_ENABLE "1") -ENDIF() -IF("${LINEAR_ACCEL}" STREQUAL "ON") -set(SENSOR_FUSION_ENABLE "1") -set(ORIENTATION_ENABLE "1") -set(GRAVITY_ENABLE "1") -set(LINEAR_ACCELERATION_ENABLE "1") -ENDIF() -IF("${SENSOR_FUSION_ENABLE}" STREQUAL "1") -add_subdirectory(sensor_fusion) -add_subdirectory(plugins/fusion) -ENDIF() -IF("${ORIENTATION_ENABLE}" STREQUAL "1") -add_subdirectory(plugins/orientation) -ENDIF() -IF("${GRAVITY_ENABLE}" STREQUAL "1") -add_subdirectory(plugins/gravity) -ENDIF() -IF("${LINEAR_ACCELERATION_ENABLE}" STREQUAL "1") -add_subdirectory(plugins/linear_accel) -ENDIF() -IF("${TILT_ENABLE}" STREQUAL "1") -add_subdirectory(plugins/tilt) -ENDIF() -IF("${UNCAL_GYRO_ENABLE}" STREQUAL "1") -add_subdirectory(plugins/uncal_gyro) -ENDIF() - -add_subdirectory(plugins/rotation_vector) diff --git a/src/server/plugins/CMakeLists.txt b/src/server/plugins/CMakeLists.txt new file mode 100755 index 0000000..2797f1f --- /dev/null +++ b/src/server/plugins/CMakeLists.txt @@ -0,0 +1,158 @@ +cmake_minimum_required(VERSION 2.6) +project(sensord-plugin CXX) + +INCLUDE(FindPkgConfig) +PKG_CHECK_MODULES(plugin_pkgs REQUIRED dlog libxml-2.0) + +FOREACH(flag ${plugin_pkgs_LDFLAGS}) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") +ENDFOREACH(flag) + +FOREACH(flag ${plugin_pkgs_CFLAGS}) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") +ENDFOREACH(flag) + +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${CMAKE_SOURCE_DIR}/src/server) +include_directories(${CMAKE_SOURCE_DIR}/src/shared) + +IF("${ACCEL}" STREQUAL "ON") +include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/accel) +list (APPEND PLUGIN_SRCS "accel/accel_sensor.cpp") +ENDIF() +IF("${GYRO}" STREQUAL "ON") +include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/gyro) +list (APPEND PLUGIN_SRCS "gyro/gyro_sensor.cpp") +ENDIF() +IF("${PROXI}" STREQUAL "ON") +include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/proxi) +list (APPEND PLUGIN_SRCS "proxi/proxi_sensor.cpp") +ENDIF() +IF("${LIGHT}" STREQUAL "ON") +include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/light) +list (APPEND PLUGIN_SRCS "light/light_sensor.cpp") +ENDIF() +IF("${GEO}" STREQUAL "ON") +include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/geo) +list (APPEND PLUGIN_SRCS "geo/geo_sensor.cpp") +ENDIF() +IF("${AUTO_ROTATION}" STREQUAL "ON") +include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/auto_rotation) +list (APPEND PLUGIN_SRCS "auto_rotation/auto_rotation_sensor.cpp") +list (APPEND PLUGIN_SRCS "auto_rotation/auto_rotation_alg.cpp") +list (APPEND PLUGIN_SRCS "auto_rotation/auto_rotation_alg_emul.cpp") +ENDIF() +IF("${PRESSURE}" STREQUAL "ON") +include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/pressure) +list (APPEND PLUGIN_SRCS "pressure/pressure_sensor.cpp") +ENDIF() +IF("${TEMPERATURE}" STREQUAL "ON") +include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/temperature) +list (APPEND PLUGIN_SRCS "temperature/temperature_sensor.cpp") +ENDIF() +IF("${HUMIDITY}" STREQUAL "ON") +include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/humidity) +list (APPEND PLUGIN_SRCS "humidity/humidity_sensor.cpp") +ENDIF() +IF("${ULTRAVIOLET}" STREQUAL "ON") +include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/ultraviolet) +list (APPEND PLUGIN_SRCS "ultraviolet/ultraviolet_sensor.cpp") +ENDIF() +IF("${BIO_LED_RED}" STREQUAL "ON") +include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/bio_led_red) +list (APPEND PLUGIN_SRCS "bio_led_red/bio_led_red_sensor.cpp") +ENDIF() +IF("${ORIENTATION}" STREQUAL "ON") +set(SENSOR_FUSION_ENABLE "1") +set(ORIENTATION_ENABLE "1") +ENDIF() +IF("${RV}" STREQUAL "ON") +set(SENSOR_FUSION_ENABLE "1") +set(RV_ENABLE "1") +ENDIF() +IF("${GEOMAGNETIC_RV}" STREQUAL "ON") +set(SENSOR_FUSION_ENABLE "1") +set(GEOMAGNETIC_RV_ENABLE "1") +ENDIF() +IF("${GAMING_RV}" STREQUAL "ON") +set(SENSOR_FUSION_ENABLE "1") +set(GAMING_RV_ENABLE "1") +ENDIF() +IF("${TILT}" STREQUAL "ON") +set(SENSOR_FUSION_ENABLE "1") +set(TILT_ENABLE "1") +ENDIF() +IF("${UNCAL_GYRO}" STREQUAL "ON") +set(SENSOR_FUSION_ENABLE "1") +set(UNCAL_GYRO_ENABLE "1") +ENDIF() +IF("${GRAVITY}" STREQUAL "ON") +set(SENSOR_FUSION_ENABLE "1") +set(ORIENTATION_ENABLE "1") +set(GRAVITY_ENABLE "1") +ENDIF() +IF("${LINEAR_ACCEL}" STREQUAL "ON") +set(SENSOR_FUSION_ENABLE "1") +set(ORIENTATION_ENABLE "1") +set(GRAVITY_ENABLE "1") +set(LINEAR_ACCELERATION_ENABLE "1") +ENDIF() +IF("${SENSOR_FUSION_ENABLE}" STREQUAL "1") +include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/sensor_fusion) +list (APPEND PLUGIN_SRCS "sensor_fusion/euler_angles.cpp") +list (APPEND PLUGIN_SRCS "sensor_fusion/matrix.cpp") +list (APPEND PLUGIN_SRCS "sensor_fusion/orientation_filter.cpp") +list (APPEND PLUGIN_SRCS "sensor_fusion/quaternion.cpp") +list (APPEND PLUGIN_SRCS "sensor_fusion/rotation_matrix.cpp") +list (APPEND PLUGIN_SRCS "sensor_fusion/sensor_data.cpp") +list (APPEND PLUGIN_SRCS "sensor_fusion/vector.cpp") +include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/fusion) +list (APPEND PLUGIN_SRCS "fusion/fusion_sensor.cpp") +ENDIF() +IF("${ORIENTATION_ENABLE}" STREQUAL "1") +include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/orientation) +list (APPEND PLUGIN_SRCS "orientation/orientation_sensor.cpp") +ENDIF() +IF("${GRAVITY_ENABLE}" STREQUAL "1") +include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/gravity) +list (APPEND PLUGIN_SRCS "gravity/gravity_sensor.cpp") +ENDIF() +IF("${LINEAR_ACCEL_ENABLE}" STREQUAL "1") +include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/linear_accel) +list (APPEND PLUGIN_SRCS "linear_accel/linear_accel_sensor.cpp") +ENDIF() +IF("${TILT_ENABLE}" STREQUAL "1") +include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/tilt) +list (APPEND PLUGIN_SRCS "tilt/tilt_sensor.cpp") +ENDIF() +IF("${UNCAL_GYRO_ENABLE}" STREQUAL "1") +include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/uncal_gyro) +list (APPEND PLUGIN_SRCS "uncal_gyro/uncal_gyro_sensor.cpp") +ENDIF() +IF("${RV_ENABLE}" STREQUAL "1") +include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/rotation_vector/rv) +list (APPEND PLUGIN_SRCS "rotation_vector/rv/rv_sensor.cpp") +ENDIF() +IF("${GEOMAGNETIC_RV_ENABLE}" STREQUAL "1") +include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/rotation_vector/geomagnetic_rv) +list (APPEND PLUGIN_SRCS "rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp") +ENDIF() +IF("${GAMING_RV_ENABLE}" STREQUAL "1") +include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/rotation_vector/gaming_rv) +list (APPEND PLUGIN_SRCS "rotation_vector/gaming_rv/gaming_rv_sensor.cpp") +ENDIF() +IF("${RV_RAW}" STREQUAL "ON") +include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/rotation_vector/rv_raw) +list (APPEND PLUGIN_SRCS "rotation_vector/rv_raw/rv_raw_sensor.cpp") +ENDIF() + +add_library(${PROJECT_NAME} SHARED + sensor_module_create.cpp + ${PLUGIN_SRCS} + ) + +target_link_libraries(${PROJECT_NAME} ${plugin_pkgs_LDFLAGS} "-lrt -ldl -pthread") + +install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}) \ No newline at end of file diff --git a/src/server/plugins/accel/CMakeLists.txt b/src/server/plugins/accel/CMakeLists.txt deleted file mode 100755 index cab1ebf..0000000 --- a/src/server/plugins/accel/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project(accel CXX) - -SET(SENSOR_NAME accel_sensor) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/client) - -FOREACH(flag ${accel_pkgs_LDFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -FOREACH(flag ${accel_pkgs_CFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -add_library(${SENSOR_NAME} SHARED - accel_sensor.cpp - ) - -target_link_libraries(${SENSOR_NAME} ${accel_pkgs_LDFLAGS} "-lm") - -install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/server/plugins/accel/accel_sensor.cpp b/src/server/plugins/accel/accel_sensor.cpp index 29341b6..9652fd4 100755 --- a/src/server/plugins/accel/accel_sensor.cpp +++ b/src/server/plugins/accel/accel_sensor.cpp @@ -182,21 +182,3 @@ void accel_sensor::raw_to_base(sensor_data_t &data) data.values[1] = RAW_DATA_TO_METRE_PER_SECOND_SQUARED_UNIT(data.values[1] * m_raw_data_unit); data.values[2] = RAW_DATA_TO_METRE_PER_SECOND_SQUARED_UNIT(data.values[2] * m_raw_data_unit); } - -extern "C" sensor_module* create(void) -{ - accel_sensor *sensor; - - try { - sensor = new(std::nothrow) accel_sensor; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/server/plugins/auto_rotation/CMakeLists.txt b/src/server/plugins/auto_rotation/CMakeLists.txt deleted file mode 100644 index ff0610b..0000000 --- a/src/server/plugins/auto_rotation/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project(auto_rotation CXX) - -SET(SENSOR_NAME auto_rotation_sensor) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/client) - -FOREACH(flag ${auto_rotation_pkgs_LDFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -FOREACH(flag ${auto_rotation_pkgs_CFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -add_library(${SENSOR_NAME} SHARED - auto_rotation_sensor.cpp - auto_rotation_alg.cpp - auto_rotation_alg_emul.cpp -) - -target_link_libraries(${SENSOR_NAME} ${auto_rotation_pkgs_LDFLAGS} "-lm") - -install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/server/plugins/auto_rotation/auto_rotation_sensor.cpp b/src/server/plugins/auto_rotation/auto_rotation_sensor.cpp index 9c8c9d9..64cef31 100755 --- a/src/server/plugins/auto_rotation/auto_rotation_sensor.cpp +++ b/src/server/plugins/auto_rotation/auto_rotation_sensor.cpp @@ -223,21 +223,3 @@ bool auto_rotation_sensor::get_properties(sensor_type_t sensor_type, sensor_prop return true; } - -extern "C" sensor_module* create(void) -{ - auto_rotation_sensor *sensor; - - try { - sensor = new(std::nothrow) auto_rotation_sensor; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/server/plugins/bio_led_red/CMakeLists.txt b/src/server/plugins/bio_led_red/CMakeLists.txt deleted file mode 100644 index 51b3db8..0000000 --- a/src/server/plugins/bio_led_red/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project(bio_led_red CXX) - -SET(SENSOR_NAME bio_led_red_sensor) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/client) - -FOREACH(flag ${bio_led_red_pkgs_LDFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -FOREACH(flag ${bio_led_red_pkgs_CFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -add_library(${SENSOR_NAME} SHARED - bio_led_red_sensor.cpp - ) - -target_link_libraries(${SENSOR_NAME} ${bio_led_red_pkgs_LDFLAGS} "-lm") - -install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/server/plugins/bio_led_red/bio_led_red_sensor.cpp b/src/server/plugins/bio_led_red/bio_led_red_sensor.cpp index b98da86..a302fbd 100755 --- a/src/server/plugins/bio_led_red/bio_led_red_sensor.cpp +++ b/src/server/plugins/bio_led_red/bio_led_red_sensor.cpp @@ -142,21 +142,3 @@ void bio_led_red_sensor::raw_to_base(sensor_data_t &data) { } - -extern "C" sensor_module* create(void) -{ - bio_led_red_sensor *sensor; - - try { - sensor = new(std::nothrow) bio_led_red_sensor; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/server/plugins/fusion/CMakeLists.txt b/src/server/plugins/fusion/CMakeLists.txt deleted file mode 100755 index 98d03c2..0000000 --- a/src/server/plugins/fusion/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project(fusion CXX) - -SET(SENSOR_NAME fusion_sensor) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/client) -include_directories(${CMAKE_SOURCE_DIR}/src/server/sensor_fusion) - -FOREACH(flag ${fusion_pkgs_LDFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -FOREACH(flag ${fusion_pkgs_CFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -add_library(${SENSOR_NAME} SHARED - fusion_sensor.cpp - ) - -target_link_libraries(${SENSOR_NAME} ${fusion_pkgs_LDFLAGS} "-lm") - -install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/server/plugins/fusion/fusion_sensor.cpp b/src/server/plugins/fusion/fusion_sensor.cpp index 40099a7..86449a1 100755 --- a/src/server/plugins/fusion/fusion_sensor.cpp +++ b/src/server/plugins/fusion/fusion_sensor.cpp @@ -76,13 +76,6 @@ using std::vector; #define ELEMENT_ROLL_ROTATION_COMPENSATION "ROLL_ROTATION_COMPENSATION" #define ELEMENT_AZIMUTH_ROTATION_COMPENSATION "AZIMUTH_ROTATION_COMPENSATION" -void pre_process_data(sensor_data &data_out, const float *data_in, float *bias, int *sign, float scale) -{ - data_out.m_data.m_vec[0] = sign[0] * (data_in[0] - bias[0]) / scale; - data_out.m_data.m_vec[1] = sign[1] * (data_in[1] - bias[1]) / scale; - data_out.m_data.m_vec[2] = sign[2] * (data_in[2] - bias[2]) / scale; -} - fusion_sensor::fusion_sensor() : m_accel_sensor(NULL) , m_gyro_sensor(NULL) @@ -474,21 +467,3 @@ bool fusion_sensor::get_properties(sensor_type_t sensor_type, sensor_properties_ return true; } - -extern "C" sensor_module* create(void) -{ - fusion_sensor *sensor; - - try { - sensor = new(std::nothrow) fusion_sensor; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/server/plugins/geo/CMakeLists.txt b/src/server/plugins/geo/CMakeLists.txt deleted file mode 100755 index 4ecac57..0000000 --- a/src/server/plugins/geo/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project(geo CXX) - -SET(SENSOR_NAME geo_sensor) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/client) - -FOREACH(flag ${geo_pkgs_LDFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -FOREACH(flag ${geo_pkgs_CFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -add_library(${SENSOR_NAME} SHARED - geo_sensor.cpp -) - -target_link_libraries(${SENSOR_NAME} ${geo_pkgs_LDFLAGS} "-lm") - -install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/server/plugins/geo/geo_sensor.cpp b/src/server/plugins/geo/geo_sensor.cpp index 39e2578..616f759 100755 --- a/src/server/plugins/geo/geo_sensor.cpp +++ b/src/server/plugins/geo/geo_sensor.cpp @@ -167,21 +167,3 @@ void geo_sensor::raw_to_base(sensor_data_t &data) data.values[1] = data.values[1] * m_resolution; data.values[2] = data.values[2] * m_resolution; } - -extern "C" sensor_module* create(void) -{ - geo_sensor *sensor; - - try { - sensor = new(std::nothrow) geo_sensor; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/server/plugins/gravity/CMakeLists.txt b/src/server/plugins/gravity/CMakeLists.txt deleted file mode 100755 index e37d2d3..0000000 --- a/src/server/plugins/gravity/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project(gravity CXX) - -SET(SENSOR_NAME gravity_sensor) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/client) -include_directories(${CMAKE_SOURCE_DIR}/src/server/sensor_fusion) - -FOREACH(flag ${gravity_pkgs_LDFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -FOREACH(flag ${gravity_pkgs_CFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -add_library(${SENSOR_NAME} SHARED - gravity_sensor.cpp - ) - -target_link_libraries(${SENSOR_NAME} ${gravity_pkgs_LDFLAGS} "-lm") - -install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/server/plugins/gravity/gravity_sensor.cpp b/src/server/plugins/gravity/gravity_sensor.cpp index 9f1a625..c1871f5 100755 --- a/src/server/plugins/gravity/gravity_sensor.cpp +++ b/src/server/plugins/gravity/gravity_sensor.cpp @@ -390,21 +390,3 @@ bool gravity_sensor::get_properties(sensor_type_t sensor_type, sensor_properties return true; } - -extern "C" sensor_module* create(void) -{ - gravity_sensor *sensor; - - try { - sensor = new(std::nothrow) gravity_sensor; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/server/plugins/gyro/CMakeLists.txt b/src/server/plugins/gyro/CMakeLists.txt deleted file mode 100755 index 6f7edd6..0000000 --- a/src/server/plugins/gyro/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project(gyro CXX) - -SET(SENSOR_NAME gyro_sensor) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/client) - -FOREACH(flag ${gyro_pkgs_LDFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -FOREACH(flag ${gyro_pkgs_CFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -add_library(${SENSOR_NAME} SHARED - gyro_sensor.cpp - ) - -target_link_libraries(${SENSOR_NAME} ${gyro_pkgs_LDFLAGS} "-lm") - -install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/server/plugins/gyro/gyro_sensor.cpp b/src/server/plugins/gyro/gyro_sensor.cpp index f9787f1..5fa0f68 100755 --- a/src/server/plugins/gyro/gyro_sensor.cpp +++ b/src/server/plugins/gyro/gyro_sensor.cpp @@ -170,21 +170,3 @@ void gyro_sensor::raw_to_base(sensor_data_t &data) data.values[1] = data.values[1] * m_resolution; data.values[2] = data.values[2] * m_resolution; } - -extern "C" sensor_module* create(void) -{ - gyro_sensor *sensor; - - try { - sensor = new(std::nothrow) gyro_sensor; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/server/plugins/light/CMakeLists.txt b/src/server/plugins/light/CMakeLists.txt deleted file mode 100755 index 44dc3bb..0000000 --- a/src/server/plugins/light/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project(light CXX) - -SET(SENSOR_NAME light_sensor) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/client) - -FOREACH(flag ${light_pkgs_LDFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -FOREACH(flag ${light_pkgs_CFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -add_library(${SENSOR_NAME} SHARED - light_sensor.cpp - ) - -target_link_libraries(${SENSOR_NAME} ${light_pkgs_LDFLAGS} "-lm") - -install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/server/plugins/light/light_sensor.cpp b/src/server/plugins/light/light_sensor.cpp index 4c6c6e8..b9e0dd0 100755 --- a/src/server/plugins/light/light_sensor.cpp +++ b/src/server/plugins/light/light_sensor.cpp @@ -191,21 +191,3 @@ void light_sensor::raw_to_level(sensor_data_t &data) data.values[0] = (int) adc_to_light_level((int)data.values[0]); data.value_count = 1; } - -extern "C" sensor_module* create(void) -{ - light_sensor *sensor; - - try { - sensor = new(std::nothrow) light_sensor; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/server/plugins/linear_accel/CMakeLists.txt b/src/server/plugins/linear_accel/CMakeLists.txt deleted file mode 100755 index 75eae9d..0000000 --- a/src/server/plugins/linear_accel/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project(linear_accel CXX) - -SET(SENSOR_NAME linear_accel_sensor) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/client) -include_directories(${CMAKE_SOURCE_DIR}/src/server/sensor_fusion) - -FOREACH(flag ${linear_accel_pkgs_LDFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -FOREACH(flag ${linear_accel_pkgs_CFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -add_library(${SENSOR_NAME} SHARED - linear_accel_sensor.cpp - ) - -target_link_libraries(${SENSOR_NAME} ${linear_accel_pkgs_LDFLAGS} "-lm") - -install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/server/plugins/linear_accel/linear_accel_sensor.cpp b/src/server/plugins/linear_accel/linear_accel_sensor.cpp index 87f2dd0..9acda38 100755 --- a/src/server/plugins/linear_accel/linear_accel_sensor.cpp +++ b/src/server/plugins/linear_accel/linear_accel_sensor.cpp @@ -429,20 +429,3 @@ bool linear_accel_sensor::get_properties(sensor_type_t sensor_type, sensor_prope return true; } -extern "C" sensor_module* create(void) -{ - linear_accel_sensor *sensor; - - try { - sensor = new(std::nothrow) linear_accel_sensor; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/server/plugins/orientation/CMakeLists.txt b/src/server/plugins/orientation/CMakeLists.txt deleted file mode 100755 index 989d597..0000000 --- a/src/server/plugins/orientation/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project(orientation CXX) - -SET(SENSOR_NAME orientation_sensor) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/client) -include_directories(${CMAKE_SOURCE_DIR}/src/server/sensor_fusion) - -FOREACH(flag ${orientation_pkgs_LDFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -FOREACH(flag ${orientation_pkgs_CFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -add_library(${SENSOR_NAME} SHARED - orientation_sensor.cpp - ) - -target_link_libraries(${SENSOR_NAME} ${orientation_pkgs_LDFLAGS} "-lm") - -install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/server/plugins/orientation/orientation_sensor.cpp b/src/server/plugins/orientation/orientation_sensor.cpp index d9e2902..10876bf 100755 --- a/src/server/plugins/orientation/orientation_sensor.cpp +++ b/src/server/plugins/orientation/orientation_sensor.cpp @@ -337,20 +337,3 @@ bool orientation_sensor::get_properties(sensor_type_t sensor_type, sensor_proper return true; } -extern "C" sensor_module* create(void) -{ - orientation_sensor *sensor; - - try { - sensor = new(std::nothrow) orientation_sensor; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/server/plugins/pressure/CMakeLists.txt b/src/server/plugins/pressure/CMakeLists.txt deleted file mode 100755 index 955f393..0000000 --- a/src/server/plugins/pressure/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project(pressure CXX) - -SET(SENSOR_NAME pressure_sensor) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/client) - -FOREACH(flag ${pressure_pkgs_LDFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -FOREACH(flag ${pressure_pkgs_CFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -add_library(${SENSOR_NAME} SHARED - pressure_sensor.cpp - ) - -target_link_libraries(${SENSOR_NAME} ${pressure_pkgs_LDFLAGS} "-lm") - -install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/server/plugins/pressure/pressure_sensor.cpp b/src/server/plugins/pressure/pressure_sensor.cpp index f528883..8352f5b 100755 --- a/src/server/plugins/pressure/pressure_sensor.cpp +++ b/src/server/plugins/pressure/pressure_sensor.cpp @@ -21,8 +21,6 @@ #include #include #include -#include -#include using std::bind1st; using std::mem_fun; @@ -33,12 +31,8 @@ using std::vector; #define SENSOR_TYPE_PRESSURE "PRESSURE" #define ELEMENT_NAME "NAME" #define ELEMENT_VENDOR "VENDOR" -#define ELEMENT_TEMPERATURE_RESOLUTION "TEMPERATURE_RESOLUTION" -#define ELEMENT_TEMPERATURE_OFFSET "TEMPERATURE_OFFSET" #define ATTR_VALUE "value" -#define SEA_LEVEL_RESOLUTION 0.01 - pressure_sensor::pressure_sensor() : m_sensor_hal(NULL) , m_resolution(0.0f) @@ -75,28 +69,6 @@ bool pressure_sensor::init() string model_id = m_sensor_hal->get_model_id(); - csensor_config &config = csensor_config::get_instance(); - - double temperature_resolution; - - if (!config.get(SENSOR_TYPE_PRESSURE, model_id, ELEMENT_TEMPERATURE_RESOLUTION, temperature_resolution)) { - ERR("[TEMPERATURE_RESOLUTION] is empty\n"); - throw ENXIO; - } - - m_temperature_resolution = (float)temperature_resolution; - INFO("m_temperature_resolution = %f\n", m_temperature_resolution); - - double temperature_offset; - - if (!config.get(SENSOR_TYPE_PRESSURE, model_id, ELEMENT_TEMPERATURE_OFFSET, temperature_offset)) { - ERR("[TEMPERATURE_OFFSET] is empty\n"); - throw ENXIO; - } - - m_temperature_offset = (float)temperature_offset; - INFO("m_temperature_offset = %f\n", m_temperature_offset); - INFO("%s is created!", sensor_base::get_name()); return true; @@ -127,7 +99,6 @@ bool pressure_sensor::process_event(void) if (get_client_cnt(PRESSURE_RAW_DATA_EVENT)) { event.sensor_id = get_id(); event.event_type = PRESSURE_RAW_DATA_EVENT; - raw_to_base(event.data); push(event); } @@ -161,19 +132,7 @@ bool pressure_sensor::get_properties(sensor_type_t sensor_type, sensor_propertie int pressure_sensor::get_sensor_data(unsigned int type, sensor_data_t &data) { - int ret; - - ret = m_sensor_hal->get_sensor_data(data); - - if (ret < 0) - return -1; - - if (type == PRESSURE_RAW_DATA_EVENT) { - raw_to_base(data); - return 0; - } - - return -1; + return m_sensor_hal->get_sensor_data(data); } bool pressure_sensor::set_interval(unsigned long interval) @@ -184,35 +143,3 @@ bool pressure_sensor::set_interval(unsigned long interval) return m_sensor_hal->set_interval(interval); } - -float pressure_sensor::pressure_to_altitude(float pressure) -{ - return 44330.0f * (1.0f - pow(pressure/m_sea_level_pressure, 1.0f/5.255f)); -} - -void pressure_sensor::raw_to_base(sensor_data_t &data) -{ - data.values[0] = data.values[0] * m_resolution; - m_sea_level_pressure = data.values[1] * SEA_LEVEL_RESOLUTION; - data.values[1] = pressure_to_altitude(data.values[0]); - data.values[2] = data.values[2] * m_temperature_resolution + m_temperature_offset; - data.value_count = 3; -} - -extern "C" sensor_module* create(void) -{ - pressure_sensor *sensor; - - try { - sensor = new(std::nothrow) pressure_sensor; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/server/plugins/pressure/pressure_sensor.h b/src/server/plugins/pressure/pressure_sensor.h index e17f587..9b7420f 100755 --- a/src/server/plugins/pressure/pressure_sensor.h +++ b/src/server/plugins/pressure/pressure_sensor.h @@ -43,15 +43,11 @@ private: sensor_hal *m_sensor_hal; float m_pressure; float m_resolution; - float m_sea_level_pressure; - float m_temperature_offset; - float m_temperature_resolution; virtual bool on_start(void); virtual bool on_stop(void); bool process_event(void); - float pressure_to_altitude(float pressure); - void raw_to_base(sensor_data_t &data); + }; #endif diff --git a/src/server/plugins/proxi/CMakeLists.txt b/src/server/plugins/proxi/CMakeLists.txt deleted file mode 100755 index 1b9d4e3..0000000 --- a/src/server/plugins/proxi/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project(proxi CXX) - -SET(SENSOR_NAME proxi_sensor) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/client) - -FOREACH(flag ${proxi_pkgs_LDFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -FOREACH(flag ${proxi_pkgs_CFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -add_library(${SENSOR_NAME} SHARED - proxi_sensor.cpp -) - -target_link_libraries(${SENSOR_NAME} ${proxi_pkgs_LDFLAGS} "-lm") - -install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/server/plugins/proxi/proxi_sensor.cpp b/src/server/plugins/proxi/proxi_sensor.cpp index fb4c07d..edf82a2 100755 --- a/src/server/plugins/proxi/proxi_sensor.cpp +++ b/src/server/plugins/proxi/proxi_sensor.cpp @@ -171,20 +171,3 @@ void proxi_sensor::raw_to_base(sensor_data_t &data) data.value_count = 1; } -extern "C" sensor_module* create(void) -{ - proxi_sensor *sensor; - - try { - sensor = new(std::nothrow) proxi_sensor; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/server/plugins/rotation_vector/CMakeLists.txt b/src/server/plugins/rotation_vector/CMakeLists.txt deleted file mode 100644 index 4be585a..0000000 --- a/src/server/plugins/rotation_vector/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -IF("${RV}" STREQUAL "ON") -add_subdirectory(rv) -ENDIF() -IF("${GEOMAGNETIC_RV}" STREQUAL "ON") -add_subdirectory(geomagnetic_rv) -ENDIF() -IF("${GAMING_RV}" STREQUAL "ON") -add_subdirectory(gaming_rv) -ENDIF() \ No newline at end of file diff --git a/src/server/plugins/rotation_vector/gaming_rv/CMakeLists.txt b/src/server/plugins/rotation_vector/gaming_rv/CMakeLists.txt deleted file mode 100755 index a43850f..0000000 --- a/src/server/plugins/rotation_vector/gaming_rv/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project(gaming_rv CXX) - -SET(SENSOR_NAME gaming_rv_sensor) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/client) -include_directories(${CMAKE_SOURCE_DIR}/src/server/sensor_fusion) - -FOREACH(flag ${gaming_rv_pkgs_LDFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -FOREACH(flag ${gaming_rv_pkgs_CFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -add_library(${SENSOR_NAME} SHARED - gaming_rv_sensor.cpp -) - -target_link_libraries(${SENSOR_NAME} ${gaming_rv_pkgs_LDFLAGS} "-lm") - -install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/server/plugins/rotation_vector/gaming_rv/gaming_rv_sensor.cpp b/src/server/plugins/rotation_vector/gaming_rv/gaming_rv_sensor.cpp index b2c2209..606a231 100755 --- a/src/server/plugins/rotation_vector/gaming_rv/gaming_rv_sensor.cpp +++ b/src/server/plugins/rotation_vector/gaming_rv/gaming_rv_sensor.cpp @@ -57,13 +57,6 @@ using std::vector; #define ELEMENT_ACCEL_SCALE "ACCEL_SCALE" #define ELEMENT_GYRO_SCALE "GYRO_SCALE" -void pre_process_data(sensor_data &data_out, const float *data_in, float *bias, int *sign, float scale) -{ - data_out.m_data.m_vec[0] = sign[0] * (data_in[0] - bias[0]) / scale; - data_out.m_data.m_vec[1] = sign[1] * (data_in[1] - bias[1]) / scale; - data_out.m_data.m_vec[2] = sign[2] * (data_in[2] - bias[2]) / scale; -} - gaming_rv_sensor::gaming_rv_sensor() : m_accel_sensor(NULL) , m_gyro_sensor(NULL) @@ -333,20 +326,3 @@ bool gaming_rv_sensor::get_properties(sensor_type_t sensor_type, sensor_properti return true; } -extern "C" sensor_module* create(void) -{ - gaming_rv_sensor *sensor; - - try { - sensor = new(std::nothrow) gaming_rv_sensor; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/server/plugins/rotation_vector/geomagnetic_rv/CMakeLists.txt b/src/server/plugins/rotation_vector/geomagnetic_rv/CMakeLists.txt deleted file mode 100755 index 4c2718d..0000000 --- a/src/server/plugins/rotation_vector/geomagnetic_rv/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project(geomagnetic_rv CXX) - -SET(SENSOR_NAME geomagnetic_rv_sensor) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/client) -include_directories(${CMAKE_SOURCE_DIR}/src/server/sensor_fusion) - -FOREACH(flag ${geomagnetic_rv_pkgs_LDFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -FOREACH(flag ${geomagnetic_rv_pkgs_CFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -add_library(${SENSOR_NAME} SHARED - geomagnetic_rv_sensor.cpp -) - -target_link_libraries(${SENSOR_NAME} ${geomagnetic_rv_pkgs_LDFLAGS} "-lm") - -install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/server/plugins/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp b/src/server/plugins/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp index 2361718..9e54ec4 100755 --- a/src/server/plugins/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp +++ b/src/server/plugins/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp @@ -243,21 +243,3 @@ bool geomagnetic_rv_sensor::get_properties(sensor_type_t sensor_type, sensor_pro return true; } - -extern "C" sensor_module* create(void) -{ - geomagnetic_rv_sensor *sensor; - - try { - sensor = new(std::nothrow) geomagnetic_rv_sensor; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/server/plugins/rotation_vector/rv/CMakeLists.txt b/src/server/plugins/rotation_vector/rv/CMakeLists.txt deleted file mode 100755 index 13759b5..0000000 --- a/src/server/plugins/rotation_vector/rv/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project(rv CXX) - -SET(SENSOR_NAME rv_sensor) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/client) -include_directories(${CMAKE_SOURCE_DIR}/src/server/sensor_fusion) - -FOREACH(flag ${rv_pkgs_LDFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -FOREACH(flag ${rv_pkgs_CFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -add_library(${SENSOR_NAME} SHARED - rv_sensor.cpp -) - -target_link_libraries(${SENSOR_NAME} ${rv_pkgs_LDFLAGS} "-lm") - -install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/server/plugins/rotation_vector/rv/rv_sensor.cpp b/src/server/plugins/rotation_vector/rv/rv_sensor.cpp index df9c18c..5cc98fa 100755 --- a/src/server/plugins/rotation_vector/rv/rv_sensor.cpp +++ b/src/server/plugins/rotation_vector/rv/rv_sensor.cpp @@ -49,13 +49,6 @@ using std::vector; #define ELEMENT_RAW_DATA_UNIT "RAW_DATA_UNIT" #define ELEMENT_DEFAULT_SAMPLING_TIME "DEFAULT_SAMPLING_TIME" -void pre_process_data(sensor_data &data_out, const float *data_in, float *bias, int *sign, float scale) -{ - data_out.m_data.m_vec[0] = sign[0] * (data_in[0] - bias[0]) / scale; - data_out.m_data.m_vec[1] = sign[1] * (data_in[1] - bias[1]) / scale; - data_out.m_data.m_vec[2] = sign[2] * (data_in[2] - bias[2]) / scale; -} - rv_sensor::rv_sensor() : m_accel_sensor(NULL) , m_gyro_sensor(NULL) @@ -266,20 +259,3 @@ bool rv_sensor::get_properties(sensor_type_t sensor_type, sensor_properties_s &p return true; } -extern "C" sensor_module* create(void) -{ - rv_sensor *sensor; - - try { - sensor = new(std::nothrow) rv_sensor; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/server/plugins/rotation_vector/rv_raw/CMakeLists.txt b/src/server/plugins/rotation_vector/rv_raw/CMakeLists.txt deleted file mode 100755 index d4cdfa1..0000000 --- a/src/server/plugins/rotation_vector/rv_raw/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project(rv_raw CXX) - -SET(SENSOR_NAME rv_raw_sensor) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/client) - -INCLUDE(FindPkgConfig) -PKG_CHECK_MODULES(rv_raw_pkgs REQUIRED vconf) - -FOREACH(flag ${rv_raw_pkgs_LDFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -FOREACH(flag ${rv_raw_pkgs_CFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -add_library(${SENSOR_NAME} SHARED - rv_raw_sensor.cpp -) - -target_link_libraries(${SENSOR_NAME} ${rv_raw_pkgs_LDFLAGS} "-lm") - -install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/server/plugins/rotation_vector/rv_raw/rv_raw_sensor.cpp b/src/server/plugins/rotation_vector/rv_raw/rv_raw_sensor.cpp index 6e989e4..81b49fc 100755 --- a/src/server/plugins/rotation_vector/rv_raw/rv_raw_sensor.cpp +++ b/src/server/plugins/rotation_vector/rv_raw/rv_raw_sensor.cpp @@ -149,21 +149,3 @@ bool rv_raw_sensor::set_interval(unsigned long interval) return m_sensor_hal->set_interval(interval); } - -extern "C" sensor_module* create(void) -{ - rv_raw_sensor *sensor; - - try { - sensor = new(std::nothrow) rv_raw_sensor; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/server/sensor_fusion/design/data/100ms/gravity/single_roll_throw/accel.txt b/src/server/plugins/sensor_fusion/design/data/100ms/gravity/single_roll_throw/accel.txt similarity index 100% rename from src/server/sensor_fusion/design/data/100ms/gravity/single_roll_throw/accel.txt rename to src/server/plugins/sensor_fusion/design/data/100ms/gravity/single_roll_throw/accel.txt diff --git a/src/server/sensor_fusion/design/data/100ms/gravity/single_roll_throw/gyro.txt b/src/server/plugins/sensor_fusion/design/data/100ms/gravity/single_roll_throw/gyro.txt similarity index 100% rename from src/server/sensor_fusion/design/data/100ms/gravity/single_roll_throw/gyro.txt rename to src/server/plugins/sensor_fusion/design/data/100ms/gravity/single_roll_throw/gyro.txt diff --git a/src/server/sensor_fusion/design/data/100ms/gravity/single_roll_throw/magnetic.txt b/src/server/plugins/sensor_fusion/design/data/100ms/gravity/single_roll_throw/magnetic.txt similarity index 100% rename from src/server/sensor_fusion/design/data/100ms/gravity/single_roll_throw/magnetic.txt rename to src/server/plugins/sensor_fusion/design/data/100ms/gravity/single_roll_throw/magnetic.txt diff --git a/src/server/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/accel.txt b/src/server/plugins/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/accel.txt similarity index 100% rename from src/server/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/accel.txt rename to src/server/plugins/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/accel.txt diff --git a/src/server/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/gyro.txt b/src/server/plugins/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/gyro.txt similarity index 100% rename from src/server/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/gyro.txt rename to src/server/plugins/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/gyro.txt diff --git a/src/server/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/magnetic.txt b/src/server/plugins/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/magnetic.txt similarity index 100% rename from src/server/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/magnetic.txt rename to src/server/plugins/sensor_fusion/design/data/100ms/linear_acceleration/move_x_y_z/magnetic.txt diff --git a/src/server/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/accel.txt b/src/server/plugins/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/accel.txt similarity index 100% rename from src/server/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/accel.txt rename to src/server/plugins/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/accel.txt diff --git a/src/server/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/gyro.txt b/src/server/plugins/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/gyro.txt similarity index 100% rename from src/server/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/gyro.txt rename to src/server/plugins/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/gyro.txt diff --git a/src/server/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/magnetic.txt b/src/server/plugins/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/magnetic.txt similarity index 100% rename from src/server/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/magnetic.txt rename to src/server/plugins/sensor_fusion/design/data/100ms/orientation/roll_pitch_yaw/magnetic.txt diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/accel b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/accel similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/accel rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/accel diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/gyro b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/gyro similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/gyro rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/gyro diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/magnetic b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/magnetic similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/magnetic rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/In_hand/magnetic diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/accel b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/accel similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/accel rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/accel diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/gyro b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/gyro similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/gyro rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/gyro diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/magnetic b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/magnetic similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/magnetic rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Pant_pocket/magnetic diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/accel b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/accel similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/accel rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/accel diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/gyro b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/gyro similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/gyro rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/gyro diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/magnetic b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/magnetic similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/magnetic rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/Shirt_pocket/magnetic diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/accel b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/accel similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/accel rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/accel diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/gyro b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/gyro similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/gyro rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/gyro diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/magnetic b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/magnetic similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/magnetic rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_down/While_talking/magnetic diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/accel b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/accel similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/accel rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/accel diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/gyro b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/gyro similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/gyro rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/gyro diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/magnetic b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/magnetic similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/magnetic rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/In_hand/magnetic diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/accel b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/accel similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/accel rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/accel diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/gyro b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/gyro similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/gyro rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/gyro diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/magnetic b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/magnetic similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/magnetic rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Pant_pocket/magnetic diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/accel b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/accel similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/accel rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/accel diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/gyro b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/gyro similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/gyro rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/gyro diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/magnetic b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/magnetic similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/magnetic rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/Shirt_pocket/magnetic diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/accel b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/accel similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/accel rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/accel diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/gyro b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/gyro similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/gyro rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/gyro diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/magnetic b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/magnetic similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/magnetic rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Climb_stairs_up/While_talking/magnetic diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/accel b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/accel similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/accel rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/accel diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/gyro b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/gyro similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/gyro rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/gyro diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/magnetic b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/magnetic similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/magnetic rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/In_hand/magnetic diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/accel b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/accel similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/accel rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/accel diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/gyro b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/gyro similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/gyro rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/gyro diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/magnetic b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/magnetic similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/magnetic rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Pant_pocket/magnetic diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/accel b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/accel similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/accel rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/accel diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/gyro b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/gyro similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/gyro rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/gyro diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/magnetic b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/magnetic similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/magnetic rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/Shirt_pocket/magnetic diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/accel b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/accel similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/accel rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/accel diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/gyro b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/gyro similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/gyro rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/gyro diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/magnetic b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/magnetic similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/magnetic rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_fast/While_talking/magnetic diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/accel b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/accel similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/accel rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/accel diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/gyro b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/gyro similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/gyro rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/gyro diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/magnetic b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/magnetic similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/magnetic rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/In_hand/magnetic diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/accel b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/accel similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/accel rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/accel diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/gyro b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/gyro similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/gyro rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/gyro diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/magnetic b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/magnetic similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/magnetic rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Pant_pocket/magnetic diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/accel b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/accel similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/accel rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/accel diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/gyro b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/gyro similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/gyro rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/gyro diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/magnetic b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/magnetic similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/magnetic rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/Shirt_pocket/magnetic diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/accel b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/accel similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/accel rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/accel diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/gyro b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/gyro similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/gyro rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/gyro diff --git a/src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/magnetic b/src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/magnetic similarity index 100% rename from src/server/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/magnetic rename to src/server/plugins/sensor_fusion/design/data/25ms/pedo/Walk_slow/While_talking/magnetic diff --git a/src/server/sensor_fusion/design/documentation/diagram/block_diagram_gravity_and_linear_acceleration.png b/src/server/plugins/sensor_fusion/design/documentation/diagram/block_diagram_gravity_and_linear_acceleration.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/diagram/block_diagram_gravity_and_linear_acceleration.png rename to src/server/plugins/sensor_fusion/design/documentation/diagram/block_diagram_gravity_and_linear_acceleration.png diff --git a/src/server/sensor_fusion/design/documentation/diagram/block_diagram_orientation_estimation.png b/src/server/plugins/sensor_fusion/design/documentation/diagram/block_diagram_orientation_estimation.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/diagram/block_diagram_orientation_estimation.png rename to src/server/plugins/sensor_fusion/design/documentation/diagram/block_diagram_orientation_estimation.png diff --git a/src/server/sensor_fusion/design/documentation/diagram/device_orientation.png b/src/server/plugins/sensor_fusion/design/documentation/diagram/device_orientation.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/diagram/device_orientation.png rename to src/server/plugins/sensor_fusion/design/documentation/diagram/device_orientation.png diff --git a/src/server/sensor_fusion/design/documentation/diagram/kalman_filter_stages.png b/src/server/plugins/sensor_fusion/design/documentation/diagram/kalman_filter_stages.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/diagram/kalman_filter_stages.png rename to src/server/plugins/sensor_fusion/design/documentation/diagram/kalman_filter_stages.png diff --git a/src/server/sensor_fusion/design/documentation/diagram/orientation_effect_on_gravity.png b/src/server/plugins/sensor_fusion/design/documentation/diagram/orientation_effect_on_gravity.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/diagram/orientation_effect_on_gravity.png rename to src/server/plugins/sensor_fusion/design/documentation/diagram/orientation_effect_on_gravity.png diff --git a/src/server/sensor_fusion/design/documentation/diagram/projection_diagram_gravity_computation.png b/src/server/plugins/sensor_fusion/design/documentation/diagram/projection_diagram_gravity_computation.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/diagram/projection_diagram_gravity_computation.png rename to src/server/plugins/sensor_fusion/design/documentation/diagram/projection_diagram_gravity_computation.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_1.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_1.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_1.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_1.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_10.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_10.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_10.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_10.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_11.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_11.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_11.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_11.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_12.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_12.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_12.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_12.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_13.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_13.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_13.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_13.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_13_updated.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_13_updated.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_13_updated.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_13_updated.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_14.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_14.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_14.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_14.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_15.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_15.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_15.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_15.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_16.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_16.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_16.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_16.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_17.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_17.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_17.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_17.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_18.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_18.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_18.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_18.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_19.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_19.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_19.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_19.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_2.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_2.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_2.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_2.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_20.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_20.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_20.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_20.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_21.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_21.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_21.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_21.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_22.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_22.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_22.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_22.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_23.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_23.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_23.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_23.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_24.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_24.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_24.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_24.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_25.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_25.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_25.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_25.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_26.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_26.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_26.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_26.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_27.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_27.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_27.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_27.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_28.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_28.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_28.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_28.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_29.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_29.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_29.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_29.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_3.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_3.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_3.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_3.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_30.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_30.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_30.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_30.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_31.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_31.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_31.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_31.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_32.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_32.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_32.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_32.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_33.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_33.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_33.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_33.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_34.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_34.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_34.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_34.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_35.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_35.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_35.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_35.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_36.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_36.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_36.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_36.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_37.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_37.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_37.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_37.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_38.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_38.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_38.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_38.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_39.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_39.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_39.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_39.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_4.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_4.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_4.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_4.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_40.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_40.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_40.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_40.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_5.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_5.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_5.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_5.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_6.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_6.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_6.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_6.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_7.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_7.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_7.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_7.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_8.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_8.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_8.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_8.png diff --git a/src/server/sensor_fusion/design/documentation/equation/equation_9.png b/src/server/plugins/sensor_fusion/design/documentation/equation/equation_9.png similarity index 100% rename from src/server/sensor_fusion/design/documentation/equation/equation_9.png rename to src/server/plugins/sensor_fusion/design/documentation/equation/equation_9.png diff --git a/src/server/sensor_fusion/design/documentation/sensor_fusion.htm b/src/server/plugins/sensor_fusion/design/documentation/sensor_fusion.htm similarity index 100% rename from src/server/sensor_fusion/design/documentation/sensor_fusion.htm rename to src/server/plugins/sensor_fusion/design/documentation/sensor_fusion.htm diff --git a/src/server/sensor_fusion/design/lib/axis_rot2quat.m b/src/server/plugins/sensor_fusion/design/lib/axis_rot2quat.m similarity index 100% rename from src/server/sensor_fusion/design/lib/axis_rot2quat.m rename to src/server/plugins/sensor_fusion/design/lib/axis_rot2quat.m diff --git a/src/server/sensor_fusion/design/lib/estimate_gaming_rv.m b/src/server/plugins/sensor_fusion/design/lib/estimate_gaming_rv.m similarity index 100% rename from src/server/sensor_fusion/design/lib/estimate_gaming_rv.m rename to src/server/plugins/sensor_fusion/design/lib/estimate_gaming_rv.m diff --git a/src/server/sensor_fusion/design/lib/estimate_geomagnetic_rv.m b/src/server/plugins/sensor_fusion/design/lib/estimate_geomagnetic_rv.m similarity index 100% rename from src/server/sensor_fusion/design/lib/estimate_geomagnetic_rv.m rename to src/server/plugins/sensor_fusion/design/lib/estimate_geomagnetic_rv.m diff --git a/src/server/sensor_fusion/design/lib/estimate_gravity.m b/src/server/plugins/sensor_fusion/design/lib/estimate_gravity.m similarity index 100% rename from src/server/sensor_fusion/design/lib/estimate_gravity.m rename to src/server/plugins/sensor_fusion/design/lib/estimate_gravity.m diff --git a/src/server/sensor_fusion/design/lib/estimate_linear_acceleration.m b/src/server/plugins/sensor_fusion/design/lib/estimate_linear_acceleration.m similarity index 100% rename from src/server/sensor_fusion/design/lib/estimate_linear_acceleration.m rename to src/server/plugins/sensor_fusion/design/lib/estimate_linear_acceleration.m diff --git a/src/server/sensor_fusion/design/lib/estimate_orientation.m b/src/server/plugins/sensor_fusion/design/lib/estimate_orientation.m similarity index 100% rename from src/server/sensor_fusion/design/lib/estimate_orientation.m rename to src/server/plugins/sensor_fusion/design/lib/estimate_orientation.m diff --git a/src/server/sensor_fusion/design/lib/euler2quat.m b/src/server/plugins/sensor_fusion/design/lib/euler2quat.m similarity index 100% rename from src/server/sensor_fusion/design/lib/euler2quat.m rename to src/server/plugins/sensor_fusion/design/lib/euler2quat.m diff --git a/src/server/sensor_fusion/design/lib/quat2euler.m b/src/server/plugins/sensor_fusion/design/lib/quat2euler.m similarity index 100% rename from src/server/sensor_fusion/design/lib/quat2euler.m rename to src/server/plugins/sensor_fusion/design/lib/quat2euler.m diff --git a/src/server/sensor_fusion/design/lib/quat2rot_mat.m b/src/server/plugins/sensor_fusion/design/lib/quat2rot_mat.m similarity index 100% rename from src/server/sensor_fusion/design/lib/quat2rot_mat.m rename to src/server/plugins/sensor_fusion/design/lib/quat2rot_mat.m diff --git a/src/server/sensor_fusion/design/lib/quat_prod.m b/src/server/plugins/sensor_fusion/design/lib/quat_prod.m similarity index 100% rename from src/server/sensor_fusion/design/lib/quat_prod.m rename to src/server/plugins/sensor_fusion/design/lib/quat_prod.m diff --git a/src/server/sensor_fusion/design/lib/rot_mat2quat.m b/src/server/plugins/sensor_fusion/design/lib/rot_mat2quat.m similarity index 100% rename from src/server/sensor_fusion/design/lib/rot_mat2quat.m rename to src/server/plugins/sensor_fusion/design/lib/rot_mat2quat.m diff --git a/src/server/sensor_fusion/design/lib/sf_pedometer.m b/src/server/plugins/sensor_fusion/design/lib/sf_pedometer.m similarity index 100% rename from src/server/sensor_fusion/design/lib/sf_pedometer.m rename to src/server/plugins/sensor_fusion/design/lib/sf_pedometer.m diff --git a/src/server/sensor_fusion/design/readme b/src/server/plugins/sensor_fusion/design/readme similarity index 100% rename from src/server/sensor_fusion/design/readme rename to src/server/plugins/sensor_fusion/design/readme diff --git a/src/server/sensor_fusion/design/sf_gaming_rv.m b/src/server/plugins/sensor_fusion/design/sf_gaming_rv.m similarity index 100% rename from src/server/sensor_fusion/design/sf_gaming_rv.m rename to src/server/plugins/sensor_fusion/design/sf_gaming_rv.m diff --git a/src/server/sensor_fusion/design/sf_geomagnetic_rv.m b/src/server/plugins/sensor_fusion/design/sf_geomagnetic_rv.m similarity index 100% rename from src/server/sensor_fusion/design/sf_geomagnetic_rv.m rename to src/server/plugins/sensor_fusion/design/sf_geomagnetic_rv.m diff --git a/src/server/sensor_fusion/design/sf_gravity.m b/src/server/plugins/sensor_fusion/design/sf_gravity.m similarity index 100% rename from src/server/sensor_fusion/design/sf_gravity.m rename to src/server/plugins/sensor_fusion/design/sf_gravity.m diff --git a/src/server/sensor_fusion/design/sf_linear_acceleration.m b/src/server/plugins/sensor_fusion/design/sf_linear_acceleration.m similarity index 100% rename from src/server/sensor_fusion/design/sf_linear_acceleration.m rename to src/server/plugins/sensor_fusion/design/sf_linear_acceleration.m diff --git a/src/server/sensor_fusion/design/sf_orientation.m b/src/server/plugins/sensor_fusion/design/sf_orientation.m similarity index 100% rename from src/server/sensor_fusion/design/sf_orientation.m rename to src/server/plugins/sensor_fusion/design/sf_orientation.m diff --git a/src/server/sensor_fusion/euler_angles.cpp b/src/server/plugins/sensor_fusion/euler_angles.cpp similarity index 100% rename from src/server/sensor_fusion/euler_angles.cpp rename to src/server/plugins/sensor_fusion/euler_angles.cpp diff --git a/src/server/sensor_fusion/euler_angles.h b/src/server/plugins/sensor_fusion/euler_angles.h similarity index 100% rename from src/server/sensor_fusion/euler_angles.h rename to src/server/plugins/sensor_fusion/euler_angles.h diff --git a/src/server/sensor_fusion/matrix.cpp b/src/server/plugins/sensor_fusion/matrix.cpp similarity index 100% rename from src/server/sensor_fusion/matrix.cpp rename to src/server/plugins/sensor_fusion/matrix.cpp diff --git a/src/server/sensor_fusion/matrix.h b/src/server/plugins/sensor_fusion/matrix.h similarity index 100% rename from src/server/sensor_fusion/matrix.h rename to src/server/plugins/sensor_fusion/matrix.h diff --git a/src/server/sensor_fusion/orientation_filter.cpp b/src/server/plugins/sensor_fusion/orientation_filter.cpp similarity index 100% rename from src/server/sensor_fusion/orientation_filter.cpp rename to src/server/plugins/sensor_fusion/orientation_filter.cpp diff --git a/src/server/sensor_fusion/orientation_filter.h b/src/server/plugins/sensor_fusion/orientation_filter.h similarity index 100% rename from src/server/sensor_fusion/orientation_filter.h rename to src/server/plugins/sensor_fusion/orientation_filter.h diff --git a/src/server/sensor_fusion/quaternion.cpp b/src/server/plugins/sensor_fusion/quaternion.cpp similarity index 100% rename from src/server/sensor_fusion/quaternion.cpp rename to src/server/plugins/sensor_fusion/quaternion.cpp diff --git a/src/server/sensor_fusion/quaternion.h b/src/server/plugins/sensor_fusion/quaternion.h similarity index 100% rename from src/server/sensor_fusion/quaternion.h rename to src/server/plugins/sensor_fusion/quaternion.h diff --git a/src/server/sensor_fusion/rotation_matrix.cpp b/src/server/plugins/sensor_fusion/rotation_matrix.cpp similarity index 100% rename from src/server/sensor_fusion/rotation_matrix.cpp rename to src/server/plugins/sensor_fusion/rotation_matrix.cpp diff --git a/src/server/sensor_fusion/rotation_matrix.h b/src/server/plugins/sensor_fusion/rotation_matrix.h similarity index 100% rename from src/server/sensor_fusion/rotation_matrix.h rename to src/server/plugins/sensor_fusion/rotation_matrix.h diff --git a/src/server/sensor_fusion/sensor_data.cpp b/src/server/plugins/sensor_fusion/sensor_data.cpp similarity index 89% rename from src/server/sensor_fusion/sensor_data.cpp rename to src/server/plugins/sensor_fusion/sensor_data.cpp index 7272800..b1191bb 100644 --- a/src/server/sensor_fusion/sensor_data.cpp +++ b/src/server/plugins/sensor_fusion/sensor_data.cpp @@ -116,5 +116,13 @@ quaternion sensor_data2quat(const sensor_data data, const vect +void pre_process_data(sensor_data &data_out, const T *data_in, T *bias, int *sign, T scale) +{ + data_out.m_data.m_vec[0] = sign[0] * (data_in[0] - bias[0]) / scale; + data_out.m_data.m_vec[1] = sign[1] * (data_in[1] - bias[1]) / scale; + data_out.m_data.m_vec[2] = sign[2] * (data_in[2] - bias[2]) / scale; +} + #endif /* _SENSOR_DATA_H_ */ diff --git a/src/server/sensor_fusion/sensor_data.h b/src/server/plugins/sensor_fusion/sensor_data.h similarity index 92% rename from src/server/sensor_fusion/sensor_data.h rename to src/server/plugins/sensor_fusion/sensor_data.h index 7998b36..78d0d49 100644 --- a/src/server/sensor_fusion/sensor_data.h +++ b/src/server/plugins/sensor_fusion/sensor_data.h @@ -49,6 +49,9 @@ public: T scaling_factor); template friend quaternion sensor_data2quat(const sensor_data data, const vect ref_vec); + template friend void pre_process_data(sensor_data &data_out, + const T *data_in, T *bias, int *sign, T scale); + }; #include "sensor_data.cpp" diff --git a/src/server/sensor_fusion/test/gravity_sensor.cpp b/src/server/plugins/sensor_fusion/test/gravity_sensor.cpp similarity index 100% rename from src/server/sensor_fusion/test/gravity_sensor.cpp rename to src/server/plugins/sensor_fusion/test/gravity_sensor.cpp diff --git a/src/server/sensor_fusion/test/gravity_sensor.h b/src/server/plugins/sensor_fusion/test/gravity_sensor.h similarity index 100% rename from src/server/sensor_fusion/test/gravity_sensor.h rename to src/server/plugins/sensor_fusion/test/gravity_sensor.h diff --git a/src/server/sensor_fusion/test/linear_acceleration_sensor.cpp b/src/server/plugins/sensor_fusion/test/linear_acceleration_sensor.cpp similarity index 100% rename from src/server/sensor_fusion/test/linear_acceleration_sensor.cpp rename to src/server/plugins/sensor_fusion/test/linear_acceleration_sensor.cpp diff --git a/src/server/sensor_fusion/test/linear_acceleration_sensor.h b/src/server/plugins/sensor_fusion/test/linear_acceleration_sensor.h similarity index 100% rename from src/server/sensor_fusion/test/linear_acceleration_sensor.h rename to src/server/plugins/sensor_fusion/test/linear_acceleration_sensor.h diff --git a/src/server/sensor_fusion/test/orientation_sensor.cpp b/src/server/plugins/sensor_fusion/test/orientation_sensor.cpp similarity index 80% rename from src/server/sensor_fusion/test/orientation_sensor.cpp rename to src/server/plugins/sensor_fusion/test/orientation_sensor.cpp index f6cd55c..477b4db 100644 --- a/src/server/sensor_fusion/test/orientation_sensor.cpp +++ b/src/server/plugins/sensor_fusion/test/orientation_sensor.cpp @@ -30,15 +30,6 @@ float scale_gyro = 1150; float scale_magnetic = 1; int magnetic_alignment_factor = -1; -void pre_process_data(sensor_data *data_out, sensor_data *data_in, float *bias, int *sign, float scale) -{ - data_out->m_data.m_vec[0] = sign[0] * (data_in->m_data.m_vec[0] - bias[0]) / scale; - data_out->m_data.m_vec[1] = sign[1] * (data_in->m_data.m_vec[1] - bias[1]) / scale; - data_out->m_data.m_vec[2] = sign[2] * (data_in->m_data.m_vec[2] - bias[2]) / scale; - - data_out->m_time_stamp = data_in->m_time_stamp; -} - void orientation_sensor::get_device_orientation(sensor_data *accel_data, sensor_data *gyro_data, sensor_data *magnetic_data) { diff --git a/src/server/sensor_fusion/test/orientation_sensor.h b/src/server/plugins/sensor_fusion/test/orientation_sensor.h similarity index 100% rename from src/server/sensor_fusion/test/orientation_sensor.h rename to src/server/plugins/sensor_fusion/test/orientation_sensor.h diff --git a/src/server/sensor_fusion/test/test_projects/euler_angles_test/.cproject b/src/server/plugins/sensor_fusion/test/test_projects/euler_angles_test/.cproject similarity index 100% rename from src/server/sensor_fusion/test/test_projects/euler_angles_test/.cproject rename to src/server/plugins/sensor_fusion/test/test_projects/euler_angles_test/.cproject diff --git a/src/server/sensor_fusion/test/test_projects/euler_angles_test/.project b/src/server/plugins/sensor_fusion/test/test_projects/euler_angles_test/.project similarity index 100% rename from src/server/sensor_fusion/test/test_projects/euler_angles_test/.project rename to src/server/plugins/sensor_fusion/test/test_projects/euler_angles_test/.project diff --git a/src/server/sensor_fusion/test/test_projects/euler_angles_test/euler_angles_main.cpp b/src/server/plugins/sensor_fusion/test/test_projects/euler_angles_test/euler_angles_main.cpp similarity index 100% rename from src/server/sensor_fusion/test/test_projects/euler_angles_test/euler_angles_main.cpp rename to src/server/plugins/sensor_fusion/test/test_projects/euler_angles_test/euler_angles_main.cpp diff --git a/src/server/sensor_fusion/test/test_projects/gravity_sensor_test/.cproject b/src/server/plugins/sensor_fusion/test/test_projects/gravity_sensor_test/.cproject similarity index 100% rename from src/server/sensor_fusion/test/test_projects/gravity_sensor_test/.cproject rename to src/server/plugins/sensor_fusion/test/test_projects/gravity_sensor_test/.cproject diff --git a/src/server/sensor_fusion/test/test_projects/gravity_sensor_test/.project b/src/server/plugins/sensor_fusion/test/test_projects/gravity_sensor_test/.project similarity index 100% rename from src/server/sensor_fusion/test/test_projects/gravity_sensor_test/.project rename to src/server/plugins/sensor_fusion/test/test_projects/gravity_sensor_test/.project diff --git a/src/server/sensor_fusion/test/test_projects/gravity_sensor_test/gravity_sensor_main.cpp b/src/server/plugins/sensor_fusion/test/test_projects/gravity_sensor_test/gravity_sensor_main.cpp similarity index 100% rename from src/server/sensor_fusion/test/test_projects/gravity_sensor_test/gravity_sensor_main.cpp rename to src/server/plugins/sensor_fusion/test/test_projects/gravity_sensor_test/gravity_sensor_main.cpp diff --git a/src/server/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.cproject b/src/server/plugins/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.cproject similarity index 100% rename from src/server/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.cproject rename to src/server/plugins/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.cproject diff --git a/src/server/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.project b/src/server/plugins/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.project similarity index 100% rename from src/server/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.project rename to src/server/plugins/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/.project diff --git a/src/server/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/linear_acceleration_sensor_main.cpp b/src/server/plugins/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/linear_acceleration_sensor_main.cpp similarity index 100% rename from src/server/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/linear_acceleration_sensor_main.cpp rename to src/server/plugins/sensor_fusion/test/test_projects/linear_acceleration_sensor_test/linear_acceleration_sensor_main.cpp diff --git a/src/server/sensor_fusion/test/test_projects/matrix_test/.cproject b/src/server/plugins/sensor_fusion/test/test_projects/matrix_test/.cproject similarity index 100% rename from src/server/sensor_fusion/test/test_projects/matrix_test/.cproject rename to src/server/plugins/sensor_fusion/test/test_projects/matrix_test/.cproject diff --git a/src/server/sensor_fusion/test/test_projects/matrix_test/.project b/src/server/plugins/sensor_fusion/test/test_projects/matrix_test/.project similarity index 100% rename from src/server/sensor_fusion/test/test_projects/matrix_test/.project rename to src/server/plugins/sensor_fusion/test/test_projects/matrix_test/.project diff --git a/src/server/sensor_fusion/test/test_projects/matrix_test/matrix_main.cpp b/src/server/plugins/sensor_fusion/test/test_projects/matrix_test/matrix_main.cpp similarity index 100% rename from src/server/sensor_fusion/test/test_projects/matrix_test/matrix_main.cpp rename to src/server/plugins/sensor_fusion/test/test_projects/matrix_test/matrix_main.cpp diff --git a/src/server/sensor_fusion/test/test_projects/orientation_sensor_test/.cproject b/src/server/plugins/sensor_fusion/test/test_projects/orientation_sensor_test/.cproject similarity index 100% rename from src/server/sensor_fusion/test/test_projects/orientation_sensor_test/.cproject rename to src/server/plugins/sensor_fusion/test/test_projects/orientation_sensor_test/.cproject diff --git a/src/server/sensor_fusion/test/test_projects/orientation_sensor_test/.project b/src/server/plugins/sensor_fusion/test/test_projects/orientation_sensor_test/.project similarity index 100% rename from src/server/sensor_fusion/test/test_projects/orientation_sensor_test/.project rename to src/server/plugins/sensor_fusion/test/test_projects/orientation_sensor_test/.project diff --git a/src/server/sensor_fusion/test/test_projects/orientation_sensor_test/orientation_sensor_main.cpp b/src/server/plugins/sensor_fusion/test/test_projects/orientation_sensor_test/orientation_sensor_main.cpp similarity index 100% rename from src/server/sensor_fusion/test/test_projects/orientation_sensor_test/orientation_sensor_main.cpp rename to src/server/plugins/sensor_fusion/test/test_projects/orientation_sensor_test/orientation_sensor_main.cpp diff --git a/src/server/sensor_fusion/test/test_projects/quaternion_test/.cproject b/src/server/plugins/sensor_fusion/test/test_projects/quaternion_test/.cproject similarity index 100% rename from src/server/sensor_fusion/test/test_projects/quaternion_test/.cproject rename to src/server/plugins/sensor_fusion/test/test_projects/quaternion_test/.cproject diff --git a/src/server/sensor_fusion/test/test_projects/quaternion_test/.project b/src/server/plugins/sensor_fusion/test/test_projects/quaternion_test/.project similarity index 100% rename from src/server/sensor_fusion/test/test_projects/quaternion_test/.project rename to src/server/plugins/sensor_fusion/test/test_projects/quaternion_test/.project diff --git a/src/server/sensor_fusion/test/test_projects/quaternion_test/quaternion_main.cpp b/src/server/plugins/sensor_fusion/test/test_projects/quaternion_test/quaternion_main.cpp similarity index 100% rename from src/server/sensor_fusion/test/test_projects/quaternion_test/quaternion_main.cpp rename to src/server/plugins/sensor_fusion/test/test_projects/quaternion_test/quaternion_main.cpp diff --git a/src/server/sensor_fusion/test/test_projects/rotation_matrix_test/.cproject b/src/server/plugins/sensor_fusion/test/test_projects/rotation_matrix_test/.cproject similarity index 100% rename from src/server/sensor_fusion/test/test_projects/rotation_matrix_test/.cproject rename to src/server/plugins/sensor_fusion/test/test_projects/rotation_matrix_test/.cproject diff --git a/src/server/sensor_fusion/test/test_projects/rotation_matrix_test/.project b/src/server/plugins/sensor_fusion/test/test_projects/rotation_matrix_test/.project similarity index 100% rename from src/server/sensor_fusion/test/test_projects/rotation_matrix_test/.project rename to src/server/plugins/sensor_fusion/test/test_projects/rotation_matrix_test/.project diff --git a/src/server/sensor_fusion/test/test_projects/rotation_matrix_test/rotation_matrix_main.cpp b/src/server/plugins/sensor_fusion/test/test_projects/rotation_matrix_test/rotation_matrix_main.cpp similarity index 100% rename from src/server/sensor_fusion/test/test_projects/rotation_matrix_test/rotation_matrix_main.cpp rename to src/server/plugins/sensor_fusion/test/test_projects/rotation_matrix_test/rotation_matrix_main.cpp diff --git a/src/server/sensor_fusion/test/test_projects/sensor_data_test/.cproject b/src/server/plugins/sensor_fusion/test/test_projects/sensor_data_test/.cproject similarity index 100% rename from src/server/sensor_fusion/test/test_projects/sensor_data_test/.cproject rename to src/server/plugins/sensor_fusion/test/test_projects/sensor_data_test/.cproject diff --git a/src/server/sensor_fusion/test/test_projects/sensor_data_test/.project b/src/server/plugins/sensor_fusion/test/test_projects/sensor_data_test/.project similarity index 100% rename from src/server/sensor_fusion/test/test_projects/sensor_data_test/.project rename to src/server/plugins/sensor_fusion/test/test_projects/sensor_data_test/.project diff --git a/src/server/sensor_fusion/test/test_projects/sensor_data_test/sensor_data_main.cpp b/src/server/plugins/sensor_fusion/test/test_projects/sensor_data_test/sensor_data_main.cpp similarity index 100% rename from src/server/sensor_fusion/test/test_projects/sensor_data_test/sensor_data_main.cpp rename to src/server/plugins/sensor_fusion/test/test_projects/sensor_data_test/sensor_data_main.cpp diff --git a/src/server/sensor_fusion/test/test_projects/vector_test/.cproject b/src/server/plugins/sensor_fusion/test/test_projects/vector_test/.cproject similarity index 100% rename from src/server/sensor_fusion/test/test_projects/vector_test/.cproject rename to src/server/plugins/sensor_fusion/test/test_projects/vector_test/.cproject diff --git a/src/server/sensor_fusion/test/test_projects/vector_test/.project b/src/server/plugins/sensor_fusion/test/test_projects/vector_test/.project similarity index 100% rename from src/server/sensor_fusion/test/test_projects/vector_test/.project rename to src/server/plugins/sensor_fusion/test/test_projects/vector_test/.project diff --git a/src/server/sensor_fusion/test/test_projects/vector_test/vector_main.cpp b/src/server/plugins/sensor_fusion/test/test_projects/vector_test/vector_main.cpp similarity index 100% rename from src/server/sensor_fusion/test/test_projects/vector_test/vector_main.cpp rename to src/server/plugins/sensor_fusion/test/test_projects/vector_test/vector_main.cpp diff --git a/src/server/sensor_fusion/vector.cpp b/src/server/plugins/sensor_fusion/vector.cpp similarity index 100% rename from src/server/sensor_fusion/vector.cpp rename to src/server/plugins/sensor_fusion/vector.cpp diff --git a/src/server/sensor_fusion/vector.h b/src/server/plugins/sensor_fusion/vector.h similarity index 100% rename from src/server/sensor_fusion/vector.h rename to src/server/plugins/sensor_fusion/vector.h diff --git a/src/server/plugins/sensor_module_create.cpp.in b/src/server/plugins/sensor_module_create.cpp.in new file mode 100644 index 0000000..dbbd356 --- /dev/null +++ b/src/server/plugins/sensor_module_create.cpp.in @@ -0,0 +1,285 @@ +#define ACCEL strcmp("@ACCEL@", "ON") +#define AUTO_ROTATION strcmp("@AUTO_ROTATION@", "ON") +#define GYRO strcmp("@GYRO@", "ON") +#define PROXI strcmp("@PROXI@", "ON") +#define LIGHT strcmp("@LIGHT@", "ON") +#define GEO strcmp("@GEO@", "ON") +#define PRESSURE strcmp("@PRESSURE@", "ON") +#define TEMPERATURE strcmp("@TEMPERATURE@", "ON") +#define ULTRAVIOLET strcmp("@ULTRAVIOLET@", "ON") +#define ORIENTATION strcmp("@ORIENTATION@", "ON") +#define GRAVITY strcmp("@GRAVITY@", "ON") +#define LINEAR_ACCEL strcmp("@LINEAR_ACCEL@", "ON") +#define GEOMAGNETIC_RV strcmp("@GEOMAGNETIC_RV@", "ON") +#define GAMING_RV strcmp("@GAMING_RV@", "ON") +#define RV strcmp("@RV@", "ON") +#define TILT strcmp("@TILT@", "ON") +#define UNCAL_GYRO strcmp("@UNCAL_GYRO@", "ON") +#define BIO_LED_RED strcmp("@BIO_LED_RED@", "ON") +#define RV_RAW strcmp("@RV_RAW@", "ON") + +#if $ACCEL == 1 +#include +#endif +#if $GYRO == 1 +#include +#endif +#if $PROXI == 1 +#include +#endif +#if $LIGHT == 1 +#include +#endif +#if $GEO == 1 +#include +#endif +#if $AUTO_ROTATION == 1 +#include +#endif +#if $PRESSURE == 1 +#include +#endif +#if $TEMPERATURE == 1 +#include +#endif +#if $HUMIDITY == 1 +#include +#endif +#if $ULTRAVIOLET == 1 +#include +#endif +#if $BIO_LED_RED == 1 +#include +#endif +#if $ORIENTATION == 1 +#include +#endif +#if $GEOMAGNETIC_RV == 1 +#include +#endif +#if $GAMING_RV == 1 +#include +#endif +#if $TILT == 1 +#include +#endif +#if $UNCAL_GYRO == 1 +#include +#endif +#if $GRAVITY == 1 +#include +#endif +#if $LINEAR_ACCEL == 1 +#include +#endif +#if $RV == 1 +#include +#endif +#if $RV_RAW == 1 +#include +#endif + +#include + +extern "C" sensor_module* create(void) +{ + sensor_module *module = new(std::nothrow) sensor_module; + retvm_if(!module, NULL, "Failed to allocate memory"); + +#if $ACCEL == 1 + accel_sensor *accel_sensor = NULL; + try { + accel_sensor = new(std::nothrow) accel_sensor; + } catch (int err) { + ERR("Failed to create accel_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (!accel_sensor) + module->sensors.push_back(accel_sensor); +#endif +#if $AUTO_ROTATION == 1 + auto_rotation_sensor *auto_rotation_sensor = NULL; + try { + auto_rotation_sensor = new(std::nothrow) auto_rotation_sensor; + } catch (int err) { + ERR("Failed to create auto_rotation_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (!auto_rotation_sensor) + module->sensors.push_back(auto_rotation_sensor); +#endif +#if $GYRO == 1 + gyro_sensor *gyro_sensor = NULL; + try { + gyro_sensor = new(std::nothrow) gyro_sensor; + } catch (int err) { + ERR("Failed to create gyro_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (!gyro_sensor) + module->sensors.push_back(gyro_sensor); +#endif +#if $PROXI == 1 + proxi_sensor *proxi_sensor = NULL; + try { + proxi_sensor = new(std::nothrow) proxi_sensor; + } catch (int err) { + ERR("Failed to create proxi_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (!proxi_sensor) + module->sensors.push_back(proxi_sensor); +#endif +#if $LIGHT == 1 + light_sensor *light_sensor = NULL; + try { + light_sensor = new(std::nothrow) light_sensor; + } catch (int err) { + ERR("Failed to create light_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (!light_sensor) + module->sensors.push_back(light_sensor); +#endif +#if $GEO == 1 + geo_sensor *geo_sensor = NULL; + try { + geo_sensor = new(std::nothrow) geo_sensor; + } catch (int err) { + ERR("Failed to create geo_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (!geo_sensor) + module->sensors.push_back(geo_sensor); +#endif +#if $PRESSURE == 1 + pressure_sensor *pressure_sensor = NULL; + try { + pressure_sensor = new(std::nothrow) pressure_sensor; + } catch (int err) { + ERR("Failed to create pressure_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (!pressure_sensor) + module->sensors.push_back(pressure_sensor); +#endif +#if $TEMPERATURE == 1 + + temperature_sensor *temperature_sensor = NULL; + try { + temperature_sensor = new(std::nothrow) temperature_sensor; + } catch (int err) { + ERR("Failed to create temperature_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (!temperature_sensor) + module->sensors.push_back(temperature_sensor); + +#endif +#if $ULTRAVIOLET == 1 + ultraviolet_sensor *ultraviolet_sensor = NULL; + try { + ultraviolet_sensor = new(std::nothrow) ultraviolet_sensor; + } catch (int err) { + ERR("Failed to create ultraviolet_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (!ultraviolet_sensor) + module->sensors.push_back(ultraviolet_sensor); +#endif +#if $ORIENTATION == 1 + orientation_sensor *orientation_sensor = NULL; + try { + orientation_sensor = new(std::nothrow) orientation_sensor; + } catch (int err) { + ERR("Failed to create orientation_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (!orientation_sensor) + module->sensors.push_back(orientation_sensor); +#endif +#if $GRAVITY == 1 + gravity_sensor *gravity_sensor = NULL; + try { + gravity_sensor = new(std::nothrow) gravity_sensor; + } catch (int err) { + ERR("Failed to create gravity_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (!gravity_sensor) + module->sensors.push_back(gravity_sensor); +#endif +#if $LINEAR_ACCEL == 1 + linear_accel_sensor *linear_accel_sensor = NULL; + try { + linear_accel_sensor = new(std::nothrow) linear_accel_sensor; + } catch (int err) { + ERR("Failed to create linear_accel_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (!linear_accel_sensor) + module->sensors.push_back(linear_accel_sensor); +#endif +#if $GEOMAGNETIC_RV == 1 + geomagnetic_rv_sensor *geomagnetic_rv_sensor = NULL; + try { + geomagnetic_rv_sensor = new(std::nothrow) geomagnetic_rv_sensor; + } catch (int err) { + ERR("Failed to create geomagnetic_rv_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (!geomagnetic_rv_sensor) + module->sensors.push_back(geomagnetic_rv_sensor); +#endif +#if $GAMING_RV == 1 + gaming_rv_sensor *gaming_rv_sensor = NULL; + try { + gaming_rv_sensor = new(std::nothrow) gaming_rv_sensor; + } catch (int err) { + ERR("Failed to create gaming_rv_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (!gaming_rv_sensor) + module->sensors.push_back(gaming_rv_sensor); +#endif +#if $RV == 1 + rv_sensor *rv_sensor = NULL; + try { + rv_sensor = new(std::nothrow) rv_sensor; + } catch (int err) { + ERR("Failed to create rv_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (!rv_sensor) + module->sensors.push_back(rv_sensor); +#endif +#if $TILT == 1 + tilt_sensor *tilt_sensor = NULL; + try { + tilt_sensor = new(std::nothrow) tilt_sensor; + } catch (int err) { + ERR("Failed to create tilt_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (!tilt_sensor) + module->sensors.push_back(tilt_sensor); +#endif +#if $UNCAL_GYRO == 1 + uncal_gyro_sensor *uncal_gyro_sensor = NULL; + try { + uncal_gyro_sensor = new(std::nothrow) uncal_gyro_sensor; + } catch (int err) { + ERR("Failed to create uncal_gyro_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (!uncal_gyro_sensor) + module->sensors.push_back(uncal_gyro_sensor); +#endif +#if $BIO_LED_RED == 1 + bio_led_red_sensor *bio_led_red_sensor = NULL; + try { + bio_led_red_sensor = new(std::nothrow) bio_led_red_sensor; + } catch (int err) { + ERR("Failed to create bio_led_red_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (!bio_led_red_sensor) + module->sensors.push_back(bio_led_red_sensor); + +#endif +#if $RV_RAW == 1 + rv_raw_sensor *rv_raw_sensor = NULL; + try { + rv_raw_sensor = new(std::nothrow) rv_raw_sensor; + } catch (int err) { + ERR("Failed to create rv_raw_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (!rv_raw_sensor) + module->sensors.push_back(rv_raw_sensor); + +#endif + + return module; +} diff --git a/src/server/plugins/temperature/CMakeLists.txt b/src/server/plugins/temperature/CMakeLists.txt deleted file mode 100755 index e230207..0000000 --- a/src/server/plugins/temperature/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project(temperature CXX) - -SET(SENSOR_NAME temperature_sensor) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/client) - -INCLUDE(FindPkgConfig) -PKG_CHECK_MODULES(temp_pkgs REQUIRED vconf) - -FOREACH(flag ${temp_pkgs_LDFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -FOREACH(flag ${temp_pkgs_CFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -add_library(${SENSOR_NAME} SHARED - temperature_sensor.cpp - ) - -target_link_libraries(${SENSOR_NAME} ${temp_pkgs_LDFLAGS} "-lm") - -install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/server/plugins/temperature/temperature_sensor.cpp b/src/server/plugins/temperature/temperature_sensor.cpp index 197efda..533dcca 100755 --- a/src/server/plugins/temperature/temperature_sensor.cpp +++ b/src/server/plugins/temperature/temperature_sensor.cpp @@ -154,21 +154,3 @@ void temperature_sensor::raw_to_base(sensor_data_t &data) data.values[0] = data.values[0] * m_resolution; data.value_count = 1; } - -extern "C" sensor_module* create(void) -{ - temperature_sensor *sensor; - - try { - sensor = new(std::nothrow) temperature_sensor; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/server/plugins/tilt/CMakeLists.txt b/src/server/plugins/tilt/CMakeLists.txt deleted file mode 100755 index 5c8312a..0000000 --- a/src/server/plugins/tilt/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project(tilt CXX) - -SET(SENSOR_NAME tilt_sensor) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/client) -include_directories(${CMAKE_SOURCE_DIR}/src/server/sensor_fusion) - -FOREACH(flag ${tilt_pkgs_LDFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -FOREACH(flag ${tilt_pkgs_CFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -add_library(${SENSOR_NAME} SHARED - tilt_sensor.cpp - ) - -target_link_libraries(${SENSOR_NAME} ${tilt_pkgs_LDFLAGS} "-lm") - -install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/server/plugins/tilt/tilt_sensor.cpp b/src/server/plugins/tilt/tilt_sensor.cpp index 918c3c1..8276f89 100755 --- a/src/server/plugins/tilt/tilt_sensor.cpp +++ b/src/server/plugins/tilt/tilt_sensor.cpp @@ -272,21 +272,3 @@ bool tilt_sensor::get_properties(sensor_type_t sensor_type, sensor_properties_s return true; } - -extern "C" sensor_module* create(void) -{ - tilt_sensor *sensor; - - try { - sensor = new(std::nothrow) tilt_sensor; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/server/plugins/ultraviolet/CMakeLists.txt b/src/server/plugins/ultraviolet/CMakeLists.txt deleted file mode 100644 index b711897..0000000 --- a/src/server/plugins/ultraviolet/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project(ultraviolet CXX) - -SET(SENSOR_NAME ultraviolet_sensor) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/client) - -FOREACH(flag ${uv_pkgs_LDFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -FOREACH(flag ${uv_pkgs_CFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -add_library(${SENSOR_NAME} SHARED - ultraviolet_sensor.cpp - ) - -target_link_libraries(${SENSOR_NAME} ${uv_pkgs_LDFLAGS} "-lm") - -install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/server/plugins/ultraviolet/ultraviolet_sensor.cpp b/src/server/plugins/ultraviolet/ultraviolet_sensor.cpp index 496dd03..360eb95 100755 --- a/src/server/plugins/ultraviolet/ultraviolet_sensor.cpp +++ b/src/server/plugins/ultraviolet/ultraviolet_sensor.cpp @@ -155,21 +155,3 @@ void ultraviolet_sensor::raw_to_base(sensor_data_t &data) { } - -extern "C" sensor_module* create(void) -{ - ultraviolet_sensor *sensor; - - try { - sensor = new(std::nothrow) ultraviolet_sensor; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/server/plugins/uncal_gyro/CMakeLists.txt b/src/server/plugins/uncal_gyro/CMakeLists.txt deleted file mode 100644 index f38b3c9..0000000 --- a/src/server/plugins/uncal_gyro/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project(uncal_gyro CXX) - -SET(SENSOR_NAME uncal_gyro_sensor) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/client) -include_directories(${CMAKE_SOURCE_DIR}/src/server/sensor_fusion) - -FOREACH(flag ${gravity_pkgs_LDFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -FOREACH(flag ${uncal_gyro_pkgs_CFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -add_library(${SENSOR_NAME} SHARED - uncal_gyro_sensor.cpp - ) - -target_link_libraries(${SENSOR_NAME} ${uncal_gyro_pkgs_LDFLAGS} "-lm") - -install(TARGETS ${SENSOR_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/server/plugins/uncal_gyro/uncal_gyro_sensor.cpp b/src/server/plugins/uncal_gyro/uncal_gyro_sensor.cpp index 2d9e60b..e53bff0 100755 --- a/src/server/plugins/uncal_gyro/uncal_gyro_sensor.cpp +++ b/src/server/plugins/uncal_gyro/uncal_gyro_sensor.cpp @@ -301,21 +301,3 @@ bool uncal_gyro_sensor::get_properties(sensor_type_t sensor_type, sensor_propert return true; } - -extern "C" sensor_module* create(void) -{ - uncal_gyro_sensor *sensor; - - try { - sensor = new(std::nothrow) uncal_gyro_sensor; - } catch (int err) { - ERR("Failed to create module, err: %d, cause: %s", err, strerror(err)); - return NULL; - } - - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module || !sensor, NULL, "Failed to allocate memory"); - - module->sensors.push_back(sensor); - return module; -} diff --git a/src/server/sensor_fusion/CMakeLists.txt b/src/server/sensor_fusion/CMakeLists.txt deleted file mode 100755 index 5779576..0000000 --- a/src/server/sensor_fusion/CMakeLists.txt +++ /dev/null @@ -1,35 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project(sensor_fusion CXX) - -# to install pkgconfig setup file. -SET(EXEC_PREFIX "\${prefix}") -SET(VERSION 1.0) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src/client) - -set(PROJECT_MAJOR_VERSION "0") -set(PROJECT_MINOR_VERSION "0") -set(PROJECT_RELEASE_VERSION "1") -set(CMAKE_VERBOSE_MAKEFILE OFF) - -add_definitions(-Wall -O3 -omit-frame-pointer) -#add_definitions(-Wall -g -D_DEBUG) -add_definitions(-DUSE_DLOG_LOG) -add_definitions(-Iinclude) - -SET(SENSOR_FUSION_NAME sensor_fusion) - -add_library(${SENSOR_FUSION_NAME} SHARED - euler_angles.cpp - matrix.cpp - orientation_filter.cpp - quaternion.cpp - rotation_matrix.cpp - sensor_data.cpp - vector.cpp - ) - -target_link_libraries(${SENSOR_FUSION_NAME} ${rpkgs_LDFLAGS} ${GLES_LDFLAGS} "-lm") - -install(TARGETS ${SENSOR_FUSION_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/sensord) diff --git a/src/server/sensor_plugin_loader.cpp b/src/server/sensor_plugin_loader.cpp old mode 100755 new mode 100644 index 2c10fd4..42187c6 --- a/src/server/sensor_plugin_loader.cpp +++ b/src/server/sensor_plugin_loader.cpp @@ -43,8 +43,8 @@ using std::static_pointer_cast; #define HAL_ELEMENT "HAL" #define SENSOR_ELEMENT "SENSOR" -#define PLUGINS_CONFIG_PATH "/usr/etc/sensor_plugins.xml" -#define PLUGINS_DIR_PATH "/sensord" +#define SENSOR_PLUGINS_DIR_PATH "/usr/lib/libsensord-plugins.so" +#define HAL_PLUGINS_DIR_PATH "/usr/lib/libsensor-hal.so" #define SENSOR_INDEX_SHIFT 16 @@ -154,47 +154,8 @@ bool sensor_plugin_loader::insert_module(plugin_type type, const string &path) bool sensor_plugin_loader::load_plugins(void) { - vector hal_paths, sensor_paths; - vector unique_hal_paths, unique_sensor_paths; - - get_paths_from_config(string(PLUGINS_CONFIG_PATH), hal_paths, sensor_paths); - get_paths_from_dir(string(LIBDIR) + string(PLUGINS_DIR_PATH), hal_paths, sensor_paths); - - //remove duplicates while keeping the original ordering => unique_*_paths - unordered_set s; - auto unique = [&s](vector &paths, const string &path) { - if (s.insert(path).second) - paths.push_back(path); - }; - - for_each(hal_paths.begin(), hal_paths.end(), - [&](const string &path) { - unique(unique_hal_paths, path); - } - ); - - for_each(sensor_paths.begin(), sensor_paths.end(), - [&](const string &path) { - unique(unique_sensor_paths, path); - } - ); - - //load plugins specified by unique_*_paths - auto insert = [&](plugin_type type, const string &path) { - insert_module(type, path); - }; - - for_each(unique_hal_paths.begin(), unique_hal_paths.end(), - [&](const string &path) { - insert(PLUGIN_TYPE_HAL, path); - } - ); - - for_each(unique_sensor_paths.begin(), unique_sensor_paths.end(), - [&](const string &path) { - insert(PLUGIN_TYPE_SENSOR, path); - } - ); + insert_module(PLUGIN_TYPE_HAL, HAL_PLUGINS_DIR_PATH); + insert_module(PLUGIN_TYPE_SENSOR, SENSOR_PLUGINS_DIR_PATH); show_sensor_info(); return true; @@ -221,115 +182,6 @@ void sensor_plugin_loader::show_sensor_info(void) INFO("===============================================\n"); } - -bool sensor_plugin_loader::get_paths_from_dir(const string &dir_path, vector &hal_paths, vector &sensor_paths) -{ - const string PLUGIN_POSTFIX = ".so"; - const string HAL_POSTFIX = "_hal.so"; - - DIR *dir = NULL; - struct dirent *dir_entry = NULL; - - dir = opendir(dir_path.c_str()); - - if (!dir) { - ERR("Failed to open dir: %s", dir_path.c_str()); - return false; - } - - string name; - - while ((dir_entry = readdir(dir))) { - name = string(dir_entry->d_name); - - if (equal(PLUGIN_POSTFIX.rbegin(), PLUGIN_POSTFIX.rend(), name.rbegin())) { - if (equal(HAL_POSTFIX.rbegin(), HAL_POSTFIX.rend(), name.rbegin())) - hal_paths.push_back(dir_path + "/" + name); - else - sensor_paths.push_back(dir_path + "/" + name); - } - } - - closedir(dir); - return true; -} - -bool sensor_plugin_loader::get_paths_from_config(const string &config_path, vector &hal_paths, vector &sensor_paths) -{ - xmlDocPtr doc; - xmlNodePtr cur; - - doc = xmlParseFile(config_path.c_str()); - - if (doc == NULL) { - ERR("There is no %s\n", config_path.c_str()); - return false; - } - - cur = xmlDocGetRootElement(doc); - - if (cur == NULL) { - ERR("There is no root element in %s\n", config_path.c_str()); - xmlFreeDoc(doc); - return false; - } - - if (xmlStrcmp(cur->name, (const xmlChar *)ROOT_ELEMENT)) { - ERR("Wrong type document: there is no [%s] root element in %s\n", ROOT_ELEMENT, config_path.c_str()); - xmlFreeDoc(doc); - return false; - } - - xmlNodePtr plugin_list_node_ptr; - xmlNodePtr module_node_ptr; - char* prop = NULL; - string path, category; - - plugin_list_node_ptr = cur->xmlChildrenNode; - - while (plugin_list_node_ptr != NULL) { - //skip garbage element, [text] - if (!xmlStrcmp(plugin_list_node_ptr->name, (const xmlChar *)TEXT_ELEMENT)) { - plugin_list_node_ptr = plugin_list_node_ptr->next; - continue; - } - - DBG("<%s>\n", (const char*)plugin_list_node_ptr->name); - - module_node_ptr = plugin_list_node_ptr->xmlChildrenNode; - while (module_node_ptr != NULL) { - if (!xmlStrcmp(module_node_ptr->name, (const xmlChar *)TEXT_ELEMENT)) { - module_node_ptr = module_node_ptr->next; - continue; - } - - prop = (char*)xmlGetProp(module_node_ptr, (const xmlChar*)PATH_ATTR); - path = prop; - free(prop); - - DBG("<%s path=\"%s\">\n", (const char*) module_node_ptr->name, path.c_str()); - - category = (const char*) plugin_list_node_ptr->name; - - if (category == string(HAL_ELEMENT)) - hal_paths.push_back(path); - else if (category == string(SENSOR_ELEMENT)) - sensor_paths.push_back(path); - - DBG("\n"); - module_node_ptr = module_node_ptr->next; - } - - DBG("\n"); - plugin_list_node_ptr = plugin_list_node_ptr->next; - } - - xmlFreeDoc(doc); - - return true; - -} - sensor_hal* sensor_plugin_loader::get_sensor_hal(sensor_hal_type_t type) { auto it_plugins = m_sensor_hals.find(type); diff --git a/src/server/sensor_plugin_loader.h b/src/server/sensor_plugin_loader.h index 8e71dcb..95c3236 100755 --- a/src/server/sensor_plugin_loader.h +++ b/src/server/sensor_plugin_loader.h @@ -66,8 +66,6 @@ private: bool load_module(const std::string &path, std::vector &sensors, void* &handle); bool insert_module(plugin_type type, const std::string &path); void show_sensor_info(void); - bool get_paths_from_dir(const std::string &dir_path, std::vector &hal_paths, std::vector &sensor_paths); - bool get_paths_from_config(const std::string &config_path, std::vector &hal_paths, std::vector &sensor_paths); sensor_hal_plugins m_sensor_hals; sensor_plugins m_sensors; diff --git a/src/shared/csensor_config.cpp b/src/shared/csensor_config.cpp deleted file mode 100755 index ba8111b..0000000 --- a/src/shared/csensor_config.cpp +++ /dev/null @@ -1,279 +0,0 @@ -/* - * libsensord-share - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include -#include "sensor_logs.h" -#include -#include -#include -#include -#include -#include - -using std::ifstream; -using std::string; -using std::istringstream; - -#define ROOT_ELEMENT "SENSOR" -#define TEXT_ELEMENT "text" -#define MODEL_ID_ATTR "id" -#define DEFAULT_ATTR "value" - -csensor_config::csensor_config() -{ -} - -csensor_config& csensor_config::get_instance(void) -{ - static bool load_done = false; - static csensor_config inst; - - if (!load_done) { - inst.load_config(SENSOR_CONFIG_FILE_PATH); - inst.get_device_id(); - if (!inst.m_device_id.empty()) - INFO("Device ID = %s", inst.m_device_id.c_str()); - else - ERR("Failed to get Device ID"); - load_done = true; - } - - return inst; -} - -bool csensor_config::load_config(const string& config_path) -{ - xmlDocPtr doc; - xmlNodePtr cur; - - DBG("csensor_config::load_config(\"%s\") is called!\n",config_path.c_str()); - - doc = xmlParseFile(config_path.c_str()); - - if (doc == NULL) { - ERR("There is no %s\n",config_path.c_str()); - return false; - } - - cur = xmlDocGetRootElement(doc); - if(cur == NULL) { - ERR("There is no root element in %s\n",config_path.c_str()); - xmlFreeDoc(doc); - return false; - } - - if(xmlStrcmp(cur->name, (const xmlChar *)ROOT_ELEMENT)) { - ERR("Wrong type document: there is no [%s] root element in %s\n",ROOT_ELEMENT,config_path.c_str()); - xmlFreeDoc(doc); - return false; - } - - xmlNodePtr model_list_node_ptr; - xmlNodePtr model_node_ptr; - xmlNodePtr element_node_ptr; - xmlAttrPtr attr_ptr; - char* prop = NULL; - - model_list_node_ptr = cur->xmlChildrenNode; - - while (model_list_node_ptr != NULL) { - //skip garbage element, [text] - if (!xmlStrcmp(model_list_node_ptr->name,(const xmlChar *)TEXT_ELEMENT)) { - model_list_node_ptr = model_list_node_ptr->next; - continue; - } - - //insert Model_list to config map - m_sensor_config[(const char*)model_list_node_ptr->name]; - DBG("<%s>\n",(const char*)model_list_node_ptr->name); - - model_node_ptr = model_list_node_ptr->xmlChildrenNode; - while (model_node_ptr != NULL){ - //skip garbage element, [text] - if (!xmlStrcmp(model_node_ptr->name,(const xmlChar *)TEXT_ELEMENT)) { - model_node_ptr = model_node_ptr->next; - continue; - } - - - string model_id; - prop = (char*)xmlGetProp(model_node_ptr,(const xmlChar*)MODEL_ID_ATTR); - model_id = prop; - free(prop); - - //insert Model to Model_list - m_sensor_config[(const char*)model_list_node_ptr->name][model_id]; - DBG("<%s id=\"%s\">\n",(const char*)model_list_node_ptr->name,model_id.c_str()); - - element_node_ptr = model_node_ptr->xmlChildrenNode; - while (element_node_ptr != NULL) { - //skip garbage element, [text] - if (!xmlStrcmp(element_node_ptr->name,(const xmlChar *)TEXT_ELEMENT)) { - element_node_ptr = element_node_ptr->next; - continue; - } - - //insert Element to Model - m_sensor_config[(const char*)model_list_node_ptr->name][model_id][(const char*)element_node_ptr->name]; - DBG("<%s id=\"%s\"><%s>\n",(const char*)model_list_node_ptr->name,model_id.c_str(),(const char*)element_node_ptr->name); - - attr_ptr = element_node_ptr->properties; - while (attr_ptr != NULL) { - - string key,value; - key = (char*)attr_ptr->name; - prop = (char*)xmlGetProp(element_node_ptr,attr_ptr->name); - value = prop; - free(prop); - - //insert attribute to Element - m_sensor_config[(const char*)model_list_node_ptr->name][model_id][(const char*)element_node_ptr->name][key]=value; - DBG("<%s id=\"%s\"><%s \"%s\"=\"%s\">\n",(const char*)model_list_node_ptr->name,model_id.c_str(),(const char*)element_node_ptr->name,key.c_str(),value.c_str()); - attr_ptr = attr_ptr->next; - } - - - element_node_ptr = element_node_ptr->next; - } - - DBG("\n"); - model_node_ptr = model_node_ptr->next; - } - - DBG("\n"); - model_list_node_ptr = model_list_node_ptr->next; - } - - xmlFreeDoc(doc); - return true; -} - - -bool csensor_config::get(const string& sensor_type,const string& model_id, const string& element, const string& attr, string& value) -{ - auto it_model_list = m_sensor_config.find(sensor_type); - - if (it_model_list == m_sensor_config.end()) { - ERR("There is no <%s> element\n",sensor_type.c_str()); - return false; - } - - auto it_model = it_model_list->second.find(model_id); - - if (it_model == it_model_list->second.end()) { - ERR("There is no <%s id=\"%s\"> element\n",sensor_type.c_str(),model_id.c_str()); - return false; - } - - auto it_element = it_model->second.find(element); - - if (it_element == it_model->second.end()) { - DBG("There is no <%s id=\"%s\"><%s> element\n",sensor_type.c_str(),model_id.c_str(),element.c_str()); - return false; - } - - auto it_attr = it_element->second.find(attr); - - if (it_attr == it_element->second.end()) { - DBG("There is no <%s id=\"%s\"><%s \"%s\">\n",sensor_type.c_str(),model_id.c_str(),element.c_str(),attr.c_str()); - return false; - } - - value = it_attr->second; - - return true; -} - -bool csensor_config::get(const string& sensor_type, const string& model_id, const string& element, const string& attr, double& value) -{ - string str_value; - - if (get(sensor_type,model_id,element,attr,str_value) == false) - return false; - - istringstream convert(str_value); - - if ( !(convert >> value)) - value = 0; - - return true; -} - -bool csensor_config::get(const string& sensor_type, const string& model_id, const string& element, const string& attr, long& value) -{ - string str_value; - - if (get(sensor_type,model_id,element,attr,str_value) == false) - return false; - - istringstream convert(str_value); - - if ( !(convert >> value)) - value = 0; - - return true; -} - -bool csensor_config::get(const string& sensor_type, const string& model_id, const string& element, string& value) -{ - if (get(sensor_type, model_id, element, m_device_id, value)) - return true; - - if (get(sensor_type, model_id, element, DEFAULT_ATTR, value)) - return true; - - return false; -} - -bool csensor_config::get(const string& sensor_type, const string& model_id, const string& element, double& value) -{ - if (get(sensor_type, model_id, element, m_device_id, value)) - return true; - - if (get(sensor_type, model_id, element, DEFAULT_ATTR, value)) - return true; - - return false; -} - -bool csensor_config::get(const string& sensor_type, const string& model_id, const string& element, long& value) -{ - if (get(sensor_type, model_id, element, m_device_id, value)) - return true; - - if (get(sensor_type, model_id, element, DEFAULT_ATTR, value)) - return true; - - return false; -} - -bool csensor_config::is_supported(const string& sensor_type,const string& model_id) -{ - auto it_model_list = m_sensor_config.find(sensor_type); - - if (it_model_list == m_sensor_config.end()) - return false; - - auto it_model = it_model_list->second.find(model_id); - - if (it_model == it_model_list->second.end()) - return false; - - return true; -} diff --git a/src/shared/csensor_config.h b/src/shared/csensor_config.h deleted file mode 100755 index 5ce6c74..0000000 --- a/src/shared/csensor_config.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * libsensord-share - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#if !defined(_CSENSOR_CONFIG_CLASS_H_) -#define _CSENSOR_CONFIG_CLASS_H_ - -#include - -#define SENSOR_CONFIG_FILE_PATH "/usr/etc/sensors.xml" - -typedef std::unordered_map Element; -/* -* an Element is a group of attributes -* -* -* "value" -> "LSM330DLC" -* -*/ - -typedef std::unordered_map Model; -/* -* a Model is a group of elements to consist of specific vendor's one sensor configuration -* -* -* -* -* -* -> -* -*/ - -typedef std::unordered_map Model_list; -/* -* a Model_list is a group of Model -* -* -* -* -* -* "lsm330dlc_accel" -> -* -*/ - -typedef std::unordered_map Sensor_config; -/* -* a SensorConfig represents sensors.xml -* -* -* -* -* "ACCEL" -> Model_list -* -*/ - -class csensor_config : public cconfig -{ -private: - csensor_config(); - csensor_config(csensor_config const&) {}; - csensor_config& operator=(csensor_config const&); - - bool load_config(const std::string& config_path); - - Sensor_config m_sensor_config; -public: - static csensor_config& get_instance(void); - - bool get(const std::string& sensor_type, const std::string& model_id, const std::string& element, const std::string& attr, std::string& value); - bool get(const std::string& sensor_type, const std::string& model_id, const std::string& element, const std::string& attr, double& value); - bool get(const std::string& sensor_type, const std::string& model_id, const std::string& element, const std::string& attr, long& value); - - bool get(const std::string& sensor_type, const std::string& model_id, const std::string& element, std::string& value); - bool get(const std::string& sensor_type, const std::string& model_id, const std::string& element, double& value); - bool get(const std::string& sensor_type, const std::string& model_id, const std::string& element, long& value); - - bool is_supported(const std::string &sensor_type, const std::string &model_id); -}; - -#endif diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 66d24d9..526a43c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -23,7 +23,7 @@ ENDFOREACH(flag) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") -link_directories(../src/client/) +link_directories(${CMAKE_SOURCE_DIR}/src/client/) add_executable(api-test src/api-test.c) add_executable(sensor-test src/sensor-test.c src/check-sensor.c) -- 2.7.4 From 30fd0dd7cde52b0f9246fce6e0b2faabcfa28ea9 Mon Sep 17 00:00:00 2001 From: Ramasamy Date: Wed, 11 Nov 2015 15:45:16 +0900 Subject: [PATCH 12/16] Cleanup of unused pkg config files - Removing unused pkg config files - cleanup Change-Id: I8e25441b4a8ca9482dfd1e4b84a1a8eb4b99df7a --- packaging/sensord.spec | 10 ++-- src/CMakeLists.txt | 1 - src/server/CMakeLists.txt | 5 +- src/server/plugins/CMakeLists.txt | 2 +- ...dule_create.cpp.in => sensor_module_create.cpp} | 3 +- src/server/sensor_hal.h | 65 ++++++++++++++++++++++ src/server/sensord-server.pc.in | 13 ----- src/shared/CMakeLists.txt | 7 --- src/shared/sensord-devel.pc.in | 13 ----- test/CMakeLists.txt | 2 - test/sensor-tc.pc | 13 ----- test/sensor-tc.pc.in | 13 ----- 12 files changed, 72 insertions(+), 75 deletions(-) rename src/server/plugins/{sensor_module_create.cpp.in => sensor_module_create.cpp} (99%) create mode 100644 src/server/sensor_hal.h delete mode 100644 src/server/sensord-server.pc.in delete mode 100755 src/shared/sensord-devel.pc.in delete mode 100644 test/sensor-tc.pc delete mode 100644 test/sensor-tc.pc.in diff --git a/packaging/sensord.spec b/packaging/sensord.spec index c4ff15f..81f613d 100644 --- a/packaging/sensord.spec +++ b/packaging/sensord.spec @@ -67,12 +67,12 @@ Requires: %{name} = %{version}-%{release} %description -n libsensord-devel Sensord shared library -%package -n libsensord-plugin +%package -n libsensord-plugins Summary: Sensord plugin library Group: System/Development Requires: %{name} = %{version}-%{release} -%description -n libsensord-plugin +%description -n libsensord-plugins Sensord plugin library %if %{build_test_suite} == "ON" @@ -145,13 +145,11 @@ systemctl daemon-reload %{_includedir}/sensord-devel/*.h %{_libdir}/libsensor.so %{_libdir}/pkgconfig/sensor.pc -%{_libdir}/pkgconfig/sensord-devel.pc -%{_libdir}/pkgconfig/sensord-server.pc %license LICENSE.APLv2 -%files -n libsensord-plugin +%files -n libsensord-plugins %defattr(-,root,root,-) -%{_libdir}/libsensord-plugin.so +%{_libdir}/libsensord-plugins.so %license LICENSE.APLv2 %if %{build_test_suite} == "ON" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 862064f..e5cd017 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -7,4 +7,3 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}) add_subdirectory(server) add_subdirectory(client) add_subdirectory(shared) - diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt index 051527f..a95f2a6 100755 --- a/src/server/CMakeLists.txt +++ b/src/server/CMakeLists.txt @@ -26,9 +26,6 @@ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie") add_executable(${PROJECT_NAME} ${SERVER_SRCS}) -target_link_libraries(${PROJECT_NAME} ${lib_pkgs_LDFLAGS} "sensord-plugin" "sensord-devel") - -configure_file(sensord-server.pc.in ${CMAKE_CURRENT_SOURCE_DIR}/sensord-server.pc @ONLY) +target_link_libraries(${PROJECT_NAME} ${lib_pkgs_LDFLAGS} "sensord-devel") install(TARGETS ${PROJECT_NAME} DESTINATION bin) -install(FILES sensord-server.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) diff --git a/src/server/plugins/CMakeLists.txt b/src/server/plugins/CMakeLists.txt index 2797f1f..2f9af09 100755 --- a/src/server/plugins/CMakeLists.txt +++ b/src/server/plugins/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.6) -project(sensord-plugin CXX) +project(sensord-plugins CXX) INCLUDE(FindPkgConfig) PKG_CHECK_MODULES(plugin_pkgs REQUIRED dlog libxml-2.0) diff --git a/src/server/plugins/sensor_module_create.cpp.in b/src/server/plugins/sensor_module_create.cpp similarity index 99% rename from src/server/plugins/sensor_module_create.cpp.in rename to src/server/plugins/sensor_module_create.cpp index dbbd356..e82b08f 100644 --- a/src/server/plugins/sensor_module_create.cpp.in +++ b/src/server/plugins/sensor_module_create.cpp @@ -79,7 +79,7 @@ #include #endif -#include +#include extern "C" sensor_module* create(void) { @@ -267,7 +267,6 @@ extern "C" sensor_module* create(void) } if (!bio_led_red_sensor) module->sensors.push_back(bio_led_red_sensor); - #endif #if $RV_RAW == 1 rv_raw_sensor *rv_raw_sensor = NULL; diff --git a/src/server/sensor_hal.h b/src/server/sensor_hal.h new file mode 100644 index 0000000..2da6406 --- /dev/null +++ b/src/server/sensor_hal.h @@ -0,0 +1,65 @@ +/* + * libsensord-share + * + * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef _SENSOR_HAL_H_ +#define _SENSOR_HAL_H_ + +typedef enum { + SENSOR_HAL_TYPE_ACCELEROMETER, + SENSOR_HAL_TYPE_GEOMAGNETIC, + SENSOR_HAL_TYPE_LIGHT, + SENSOR_HAL_TYPE_PROXIMITY, + SENSOR_HAL_TYPE_GYROSCOPE, + SENSOR_HAL_TYPE_PRESSURE, + SENSOR_HAL_TYPE_CONTEXT, + SENSOR_HAL_TYPE_BIO, + SENSOR_HAL_TYPE_BIO_HRM, + SENSOR_HAL_TYPE_PIR, + SENSOR_HAL_TYPE_PIR_LONG, + SENSOR_HAL_TYPE_TEMPERATURE, + SENSOR_HAL_TYPE_HUMIDITY, + SENSOR_HAL_TYPE_ULTRAVIOLET, + SENSOR_HAL_TYPE_DUST, + SENSOR_HAL_TYPE_BIO_LED_IR, + SENSOR_HAL_TYPE_BIO_LED_RED, + SENSOR_HAL_TYPE_BIO_LED_GREEN, + SENSOR_HAL_TYPE_RV_RAW, + SENSOR_HAL_TYPE_GYROSCOPE_UNCAL, + SENSOR_HAL_TYPE_GEOMAGNETIC_UNCAL, + SENSOR_HAL_TYPE_FUSION, +} sensor_hal_type_t; + + + +class sensor_hal +{ +public: + sensor_hal(){}; + virtual ~sensor_hal(){}; + + virtual std::string get_model_id(void) = 0; + virtual sensor_hal_type_t get_type(void) = 0; + virtual bool enable(void) = 0; + virtual bool disable(void) = 0; + virtual bool is_data_ready(void) = 0; + virtual bool set_interval(unsigned long val) = 0; + virtual int get_sensor_data(sensor_data_t &data) = 0; + virtual bool get_properties(sensor_properties_s &properties) = 0; +}; +#endif /*_SENSOR_HAL_H_*/ diff --git a/src/server/sensord-server.pc.in b/src/server/sensord-server.pc.in deleted file mode 100644 index d03b10f..0000000 --- a/src/server/sensord-server.pc.in +++ /dev/null @@ -1,13 +0,0 @@ -# Package Information for pkg-config - -prefix=@PREFIX@ -exec_prefix=@EXEC_PREFIX@ -libdir=@LIBDIR@ -includedir=@INCLUDEDIR@/sf_common - -Name: libsensord-server -Description: Commonly used code and defintions for sensord and sensord-proprietary -Version: @VERSION@ -Requires: -Libs: -L${libdir} -lsensord-server -Cflags: -I${includedir} diff --git a/src/shared/CMakeLists.txt b/src/shared/CMakeLists.txt index a44bce0..df5670c 100644 --- a/src/shared/CMakeLists.txt +++ b/src/shared/CMakeLists.txt @@ -17,7 +17,6 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/client) - add_library(${PROJECT_NAME} SHARED cbase_lock.cpp cmutex.cpp @@ -27,15 +26,10 @@ add_library(${PROJECT_NAME} SHARED sensor_info.cpp ) - target_link_libraries(${PROJECT_NAME} ${shared_pkgs_LDFLAGS} "-lrt -ldl -pthread") -configure_file(${PROJECT_NAME}.pc.in ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc @ONLY) - - install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}) -install(FILES ${PROJECT_NAME}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) install(FILES cpacket.h csocket.h @@ -44,7 +38,6 @@ install(FILES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} ) - install(FILES sensor_deprecated.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) install(FILES sensor_types.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) install(FILES sensor_internal_deprecated.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor/) diff --git a/src/shared/sensord-devel.pc.in b/src/shared/sensord-devel.pc.in deleted file mode 100755 index 3c6eddc..0000000 --- a/src/shared/sensord-devel.pc.in +++ /dev/null @@ -1,13 +0,0 @@ -# Package Information for pkg-config - -prefix=@PREFIX@ -exec_prefix=@EXEC_PREFIX@ -libdir=@LIBDIR@ -includedir=@INCLUDEDIR@/sf_common - -Name: libsf_common -Description: Commonly used code and defintions for the sensor framework. -Version: @VERSION@ -Requires: -Libs: -L${libdir} -lsensord-share -Cflags: -I${includedir} diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 526a43c..51e778f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -11,8 +11,6 @@ pkg_check_modules(pkgs REQUIRED glib-2.0) add_definitions(${rpkgs_CFLAGS}) add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}") -configure_file(${PROJECT_NAME}.pc.in ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc @ONLY) - include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/client) include_directories(${CMAKE_SOURCE_DIR}/src/shared) diff --git a/test/sensor-tc.pc b/test/sensor-tc.pc deleted file mode 100644 index c8c0d3c..0000000 --- a/test/sensor-tc.pc +++ /dev/null @@ -1,13 +0,0 @@ -# Package Information for pkg-config - -prefix=/usr/bin -exec_prefix=${prefix} -libdir=${prefix}/${_libdir} -includedir=${prefix}/include/sensor-tc - -Name: sensor-tc -Description: Sensor functional testing library -Version: 1.0 -Requires: -Libs: -L${libdir} -lsensor-tc -Cflags: -I${includedir} diff --git a/test/sensor-tc.pc.in b/test/sensor-tc.pc.in deleted file mode 100644 index 0f821b6..0000000 --- a/test/sensor-tc.pc.in +++ /dev/null @@ -1,13 +0,0 @@ -# Package Information for pkg-config - -prefix=@PREFIX@ -exec_prefix=@EXEC_PREFIX@ -libdir=@LIBDIR@ -includedir=@INCLUDEDIR@/sensor-tc - -Name: sensor-tc -Description: Sensor functional testing library -Version: @VERSION@ -Requires: -Libs: -L${libdir} -lsensor-tc -Cflags: -I${includedir} -- 2.7.4 From 9e91549c594742cd3e1cd49e021bdb5f33bc233e Mon Sep 17 00:00:00 2001 From: Ramasamy Date: Thu, 12 Nov 2015 11:04:55 +0900 Subject: [PATCH 13/16] Debugging issues for loading and execution - Accelerometer sensor loads and works correctly. - The build system is independent for both sensord and sensor-haDebugging issues for loading and execution Change-Id: Iff3066bfe211cdbd21999940ad5fb44d8483045a --- packaging/sensord.spec | 37 ++-- src/server/plugins/CMakeLists.txt | 39 +++- src/server/plugins/sensor_module_create.cpp | 284 ------------------------ src/server/plugins/sensor_module_create.cpp.in | 288 +++++++++++++++++++++++++ 4 files changed, 340 insertions(+), 308 deletions(-) delete mode 100644 src/server/plugins/sensor_module_create.cpp create mode 100644 src/server/plugins/sensor_module_create.cpp.in diff --git a/packaging/sensord.spec b/packaging/sensord.spec index 81f613d..03ab16a 100644 --- a/packaging/sensord.spec +++ b/packaging/sensord.spec @@ -21,23 +21,24 @@ BuildRequires: pkgconfig(cynara-client) BuildRequires: pkgconfig(cynara-session) %define accel_state ON -%define auto_rotation_state ON -%define gyro_state ON -%define proxi_state ON -%define light_state ON -%define geo_state ON -%define pressure_state ON -%define temperature_state ON -%define ultraviolet_state ON -%define orientation_state ON -%define gravity_state ON -%define linear_accel_state ON -%define rv_state ON -%define geomagnetic_rv_state ON -%define gaming_rv_state ON -%define tilt_state ON -%define uncal_gyro_state ON -%define bio_led_red_state ON +%define auto_rotation_state OFF +%define gyro_state OFF +%define proxi_state OFF +%define light_state OFF +%define geo_state OFF +%define pressure_state OFF +%define temperature_state OFF +%define ultraviolet_state OFF +%define orientation_state OFF +%define gravity_state OFF +%define linear_accel_state OFF +%define rv_state OFF +%define rv_raw_state OFF +%define geomagnetic_rv_state OFF +%define gaming_rv_state OFF +%define tilt_state OFF +%define uncal_gyro_state OFF +%define bio_led_red_state OFF %define build_test_suite ON %description @@ -95,7 +96,7 @@ cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DACCEL=%{accel_state} \ -DGYRO=%{gyro_state} -DPROXI=%{proxi_state} -DLIGHT=%{light_state} \ -DGEO=%{geo_state} -DPRESSURE=%{pressure_state} -DTEMPERATURE=%{temperature_state} \ -DORIENTATION=%{orientation_state} -DGRAVITY=%{gravity_state} \ - -DLINEAR_ACCEL=%{linear_accel_state} -DRV=%{rv_state} \ + -DLINEAR_ACCEL=%{linear_accel_state} -DRV=%{rv_state} -DRV_RAW=%{rv_raw_state} \ -DGEOMAGNETIC_RV=%{geomagnetic_rv_state} -DGAMING_RV=%{gaming_rv_state} \ -DUNCAL_GYRO=%{uncal_gyro_state} -DAUTO_ROTATION=%{auto_rotation_state} \ -DTILT=%{tilt_state} -DULTRAVIOLET=%{ultraviolet_state} \ diff --git a/src/server/plugins/CMakeLists.txt b/src/server/plugins/CMakeLists.txt index 2f9af09..8ce6ea5 100755 --- a/src/server/plugins/CMakeLists.txt +++ b/src/server/plugins/CMakeLists.txt @@ -21,83 +21,108 @@ include_directories(${CMAKE_SOURCE_DIR}/src/shared) IF("${ACCEL}" STREQUAL "ON") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/accel) list (APPEND PLUGIN_SRCS "accel/accel_sensor.cpp") +add_definitions(-DENABLE_ACCEL) ENDIF() IF("${GYRO}" STREQUAL "ON") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/gyro) list (APPEND PLUGIN_SRCS "gyro/gyro_sensor.cpp") +add_definitions(-DENABLE_GYRO) ENDIF() IF("${PROXI}" STREQUAL "ON") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/proxi) list (APPEND PLUGIN_SRCS "proxi/proxi_sensor.cpp") +add_definitions(-DENABLE_PROXI) ENDIF() IF("${LIGHT}" STREQUAL "ON") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/light) list (APPEND PLUGIN_SRCS "light/light_sensor.cpp") +add_definitions(-DENABLE_LIGHT) ENDIF() IF("${GEO}" STREQUAL "ON") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/geo) list (APPEND PLUGIN_SRCS "geo/geo_sensor.cpp") +add_definitions(-DENABLE_GEO) ENDIF() IF("${AUTO_ROTATION}" STREQUAL "ON") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/auto_rotation) -list (APPEND PLUGIN_SRCS "auto_rotation/auto_rotation_sensor.cpp") list (APPEND PLUGIN_SRCS "auto_rotation/auto_rotation_alg.cpp") list (APPEND PLUGIN_SRCS "auto_rotation/auto_rotation_alg_emul.cpp") +list (APPEND PLUGIN_SRCS "auto_rotation/auto_rotation_sensor.cpp") +add_definitions(-DENABLE_AUTO_ROTATION) ENDIF() IF("${PRESSURE}" STREQUAL "ON") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/pressure) list (APPEND PLUGIN_SRCS "pressure/pressure_sensor.cpp") +add_definitions(-DENABLE_PRESSURE) ENDIF() IF("${TEMPERATURE}" STREQUAL "ON") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/temperature) list (APPEND PLUGIN_SRCS "temperature/temperature_sensor.cpp") -ENDIF() -IF("${HUMIDITY}" STREQUAL "ON") -include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/humidity) -list (APPEND PLUGIN_SRCS "humidity/humidity_sensor.cpp") +add_definitions(-DENABLE_TEMPERATURE) ENDIF() IF("${ULTRAVIOLET}" STREQUAL "ON") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/ultraviolet) list (APPEND PLUGIN_SRCS "ultraviolet/ultraviolet_sensor.cpp") +add_definitions(-DENABLE_ULTRAVIOLET) ENDIF() IF("${BIO_LED_RED}" STREQUAL "ON") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/bio_led_red) list (APPEND PLUGIN_SRCS "bio_led_red/bio_led_red_sensor.cpp") +add_definitions(-DENABLE_BIO_LED_RED) ENDIF() IF("${ORIENTATION}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") set(ORIENTATION_ENABLE "1") +add_definitions(-DENABLE_SENSOR_FUSION) +add_definitions(-DENABLE_ORIENTATION) ENDIF() IF("${RV}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") set(RV_ENABLE "1") +add_definitions(-DENABLE_SENSOR_FUSION) +add_definitions(-DENABLE_RV) ENDIF() IF("${GEOMAGNETIC_RV}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") set(GEOMAGNETIC_RV_ENABLE "1") +add_definitions(-DENABLE_SENSOR_FUSION) +add_definitions(-DENABLE_GEOMAGNETIC_RV) ENDIF() IF("${GAMING_RV}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") set(GAMING_RV_ENABLE "1") +add_definitions(-DENABLE_SENSOR_FUSION) +add_definitions(-DENABLE_GAMING_RV) ENDIF() IF("${TILT}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") set(TILT_ENABLE "1") +add_definitions(-DENABLE_SENSOR_FUSION) +add_definitions(-DENABLE_TILT) ENDIF() IF("${UNCAL_GYRO}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") set(UNCAL_GYRO_ENABLE "1") +add_definitions(-DENABLE_SENSOR_FUSION) +add_definitions(-DENABLE_UNCAL_GYRO) ENDIF() IF("${GRAVITY}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") set(ORIENTATION_ENABLE "1") set(GRAVITY_ENABLE "1") +add_definitions(-DENABLE_SENSOR_FUSION) +add_definitions(-DENABLE_ORIENTATION) +add_definitions(-DENABLE_GRAVITY) ENDIF() IF("${LINEAR_ACCEL}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") set(ORIENTATION_ENABLE "1") set(GRAVITY_ENABLE "1") -set(LINEAR_ACCELERATION_ENABLE "1") +set(LINEAR_ACCEL_ENABLE "1") +add_definitions(-DENABLE_SENSOR_FUSION) +add_definitions(-DENABLE_ORIENTATION) +add_definitions(-DENABLE_GRAVITY) +add_definitions(-DENABLE_LINEAR_ACCEL) ENDIF() IF("${SENSOR_FUSION_ENABLE}" STREQUAL "1") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/sensor_fusion) @@ -148,6 +173,8 @@ include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/rotation_vector/rv_ra list (APPEND PLUGIN_SRCS "rotation_vector/rv_raw/rv_raw_sensor.cpp") ENDIF() +configure_file(sensor_module_create.cpp.in sensor_module_create.cpp) + add_library(${PROJECT_NAME} SHARED sensor_module_create.cpp ${PLUGIN_SRCS} diff --git a/src/server/plugins/sensor_module_create.cpp b/src/server/plugins/sensor_module_create.cpp deleted file mode 100644 index e82b08f..0000000 --- a/src/server/plugins/sensor_module_create.cpp +++ /dev/null @@ -1,284 +0,0 @@ -#define ACCEL strcmp("@ACCEL@", "ON") -#define AUTO_ROTATION strcmp("@AUTO_ROTATION@", "ON") -#define GYRO strcmp("@GYRO@", "ON") -#define PROXI strcmp("@PROXI@", "ON") -#define LIGHT strcmp("@LIGHT@", "ON") -#define GEO strcmp("@GEO@", "ON") -#define PRESSURE strcmp("@PRESSURE@", "ON") -#define TEMPERATURE strcmp("@TEMPERATURE@", "ON") -#define ULTRAVIOLET strcmp("@ULTRAVIOLET@", "ON") -#define ORIENTATION strcmp("@ORIENTATION@", "ON") -#define GRAVITY strcmp("@GRAVITY@", "ON") -#define LINEAR_ACCEL strcmp("@LINEAR_ACCEL@", "ON") -#define GEOMAGNETIC_RV strcmp("@GEOMAGNETIC_RV@", "ON") -#define GAMING_RV strcmp("@GAMING_RV@", "ON") -#define RV strcmp("@RV@", "ON") -#define TILT strcmp("@TILT@", "ON") -#define UNCAL_GYRO strcmp("@UNCAL_GYRO@", "ON") -#define BIO_LED_RED strcmp("@BIO_LED_RED@", "ON") -#define RV_RAW strcmp("@RV_RAW@", "ON") - -#if $ACCEL == 1 -#include -#endif -#if $GYRO == 1 -#include -#endif -#if $PROXI == 1 -#include -#endif -#if $LIGHT == 1 -#include -#endif -#if $GEO == 1 -#include -#endif -#if $AUTO_ROTATION == 1 -#include -#endif -#if $PRESSURE == 1 -#include -#endif -#if $TEMPERATURE == 1 -#include -#endif -#if $HUMIDITY == 1 -#include -#endif -#if $ULTRAVIOLET == 1 -#include -#endif -#if $BIO_LED_RED == 1 -#include -#endif -#if $ORIENTATION == 1 -#include -#endif -#if $GEOMAGNETIC_RV == 1 -#include -#endif -#if $GAMING_RV == 1 -#include -#endif -#if $TILT == 1 -#include -#endif -#if $UNCAL_GYRO == 1 -#include -#endif -#if $GRAVITY == 1 -#include -#endif -#if $LINEAR_ACCEL == 1 -#include -#endif -#if $RV == 1 -#include -#endif -#if $RV_RAW == 1 -#include -#endif - -#include - -extern "C" sensor_module* create(void) -{ - sensor_module *module = new(std::nothrow) sensor_module; - retvm_if(!module, NULL, "Failed to allocate memory"); - -#if $ACCEL == 1 - accel_sensor *accel_sensor = NULL; - try { - accel_sensor = new(std::nothrow) accel_sensor; - } catch (int err) { - ERR("Failed to create accel_sensor module, err: %d, cause: %s", err, strerror(err)); - } - if (!accel_sensor) - module->sensors.push_back(accel_sensor); -#endif -#if $AUTO_ROTATION == 1 - auto_rotation_sensor *auto_rotation_sensor = NULL; - try { - auto_rotation_sensor = new(std::nothrow) auto_rotation_sensor; - } catch (int err) { - ERR("Failed to create auto_rotation_sensor module, err: %d, cause: %s", err, strerror(err)); - } - if (!auto_rotation_sensor) - module->sensors.push_back(auto_rotation_sensor); -#endif -#if $GYRO == 1 - gyro_sensor *gyro_sensor = NULL; - try { - gyro_sensor = new(std::nothrow) gyro_sensor; - } catch (int err) { - ERR("Failed to create gyro_sensor module, err: %d, cause: %s", err, strerror(err)); - } - if (!gyro_sensor) - module->sensors.push_back(gyro_sensor); -#endif -#if $PROXI == 1 - proxi_sensor *proxi_sensor = NULL; - try { - proxi_sensor = new(std::nothrow) proxi_sensor; - } catch (int err) { - ERR("Failed to create proxi_sensor module, err: %d, cause: %s", err, strerror(err)); - } - if (!proxi_sensor) - module->sensors.push_back(proxi_sensor); -#endif -#if $LIGHT == 1 - light_sensor *light_sensor = NULL; - try { - light_sensor = new(std::nothrow) light_sensor; - } catch (int err) { - ERR("Failed to create light_sensor module, err: %d, cause: %s", err, strerror(err)); - } - if (!light_sensor) - module->sensors.push_back(light_sensor); -#endif -#if $GEO == 1 - geo_sensor *geo_sensor = NULL; - try { - geo_sensor = new(std::nothrow) geo_sensor; - } catch (int err) { - ERR("Failed to create geo_sensor module, err: %d, cause: %s", err, strerror(err)); - } - if (!geo_sensor) - module->sensors.push_back(geo_sensor); -#endif -#if $PRESSURE == 1 - pressure_sensor *pressure_sensor = NULL; - try { - pressure_sensor = new(std::nothrow) pressure_sensor; - } catch (int err) { - ERR("Failed to create pressure_sensor module, err: %d, cause: %s", err, strerror(err)); - } - if (!pressure_sensor) - module->sensors.push_back(pressure_sensor); -#endif -#if $TEMPERATURE == 1 - - temperature_sensor *temperature_sensor = NULL; - try { - temperature_sensor = new(std::nothrow) temperature_sensor; - } catch (int err) { - ERR("Failed to create temperature_sensor module, err: %d, cause: %s", err, strerror(err)); - } - if (!temperature_sensor) - module->sensors.push_back(temperature_sensor); - -#endif -#if $ULTRAVIOLET == 1 - ultraviolet_sensor *ultraviolet_sensor = NULL; - try { - ultraviolet_sensor = new(std::nothrow) ultraviolet_sensor; - } catch (int err) { - ERR("Failed to create ultraviolet_sensor module, err: %d, cause: %s", err, strerror(err)); - } - if (!ultraviolet_sensor) - module->sensors.push_back(ultraviolet_sensor); -#endif -#if $ORIENTATION == 1 - orientation_sensor *orientation_sensor = NULL; - try { - orientation_sensor = new(std::nothrow) orientation_sensor; - } catch (int err) { - ERR("Failed to create orientation_sensor module, err: %d, cause: %s", err, strerror(err)); - } - if (!orientation_sensor) - module->sensors.push_back(orientation_sensor); -#endif -#if $GRAVITY == 1 - gravity_sensor *gravity_sensor = NULL; - try { - gravity_sensor = new(std::nothrow) gravity_sensor; - } catch (int err) { - ERR("Failed to create gravity_sensor module, err: %d, cause: %s", err, strerror(err)); - } - if (!gravity_sensor) - module->sensors.push_back(gravity_sensor); -#endif -#if $LINEAR_ACCEL == 1 - linear_accel_sensor *linear_accel_sensor = NULL; - try { - linear_accel_sensor = new(std::nothrow) linear_accel_sensor; - } catch (int err) { - ERR("Failed to create linear_accel_sensor module, err: %d, cause: %s", err, strerror(err)); - } - if (!linear_accel_sensor) - module->sensors.push_back(linear_accel_sensor); -#endif -#if $GEOMAGNETIC_RV == 1 - geomagnetic_rv_sensor *geomagnetic_rv_sensor = NULL; - try { - geomagnetic_rv_sensor = new(std::nothrow) geomagnetic_rv_sensor; - } catch (int err) { - ERR("Failed to create geomagnetic_rv_sensor module, err: %d, cause: %s", err, strerror(err)); - } - if (!geomagnetic_rv_sensor) - module->sensors.push_back(geomagnetic_rv_sensor); -#endif -#if $GAMING_RV == 1 - gaming_rv_sensor *gaming_rv_sensor = NULL; - try { - gaming_rv_sensor = new(std::nothrow) gaming_rv_sensor; - } catch (int err) { - ERR("Failed to create gaming_rv_sensor module, err: %d, cause: %s", err, strerror(err)); - } - if (!gaming_rv_sensor) - module->sensors.push_back(gaming_rv_sensor); -#endif -#if $RV == 1 - rv_sensor *rv_sensor = NULL; - try { - rv_sensor = new(std::nothrow) rv_sensor; - } catch (int err) { - ERR("Failed to create rv_sensor module, err: %d, cause: %s", err, strerror(err)); - } - if (!rv_sensor) - module->sensors.push_back(rv_sensor); -#endif -#if $TILT == 1 - tilt_sensor *tilt_sensor = NULL; - try { - tilt_sensor = new(std::nothrow) tilt_sensor; - } catch (int err) { - ERR("Failed to create tilt_sensor module, err: %d, cause: %s", err, strerror(err)); - } - if (!tilt_sensor) - module->sensors.push_back(tilt_sensor); -#endif -#if $UNCAL_GYRO == 1 - uncal_gyro_sensor *uncal_gyro_sensor = NULL; - try { - uncal_gyro_sensor = new(std::nothrow) uncal_gyro_sensor; - } catch (int err) { - ERR("Failed to create uncal_gyro_sensor module, err: %d, cause: %s", err, strerror(err)); - } - if (!uncal_gyro_sensor) - module->sensors.push_back(uncal_gyro_sensor); -#endif -#if $BIO_LED_RED == 1 - bio_led_red_sensor *bio_led_red_sensor = NULL; - try { - bio_led_red_sensor = new(std::nothrow) bio_led_red_sensor; - } catch (int err) { - ERR("Failed to create bio_led_red_sensor module, err: %d, cause: %s", err, strerror(err)); - } - if (!bio_led_red_sensor) - module->sensors.push_back(bio_led_red_sensor); -#endif -#if $RV_RAW == 1 - rv_raw_sensor *rv_raw_sensor = NULL; - try { - rv_raw_sensor = new(std::nothrow) rv_raw_sensor; - } catch (int err) { - ERR("Failed to create rv_raw_sensor module, err: %d, cause: %s", err, strerror(err)); - } - if (!rv_raw_sensor) - module->sensors.push_back(rv_raw_sensor); - -#endif - - return module; -} diff --git a/src/server/plugins/sensor_module_create.cpp.in b/src/server/plugins/sensor_module_create.cpp.in new file mode 100644 index 0000000..2008bb5 --- /dev/null +++ b/src/server/plugins/sensor_module_create.cpp.in @@ -0,0 +1,288 @@ +#ifdef ENABLE_ACCEL +#include +#endif +#ifdef ENABLE_GYRO +#include +#endif +#ifdef ENABLE_PROXI +#include +#endif +#ifdef ENABLE_LIGHT +#include +#endif +#ifdef ENABLE_GEO +#include +#endif +#ifdef ENABLE_AUTO_ROTATION +#include +#endif +#ifdef ENABLE_PRESSURE +#include +#endif +#ifdef ENABLE_TEMPERATURE +#include +#endif +#ifdef ENABLE_ULTRAVIOLET +#include +#endif +#ifdef ENABLE_BIO_LED_RED +#include +#endif +#ifdef ENABLE_ORIENTATION +#include +#endif +#ifdef ENABLE_GEOMAGNETIC_RV +#include +#endif +#ifdef ENABLE_GAMING_RV +#include +#endif +#ifdef ENABLE_TILT +#include +#endif +#ifdef ENABLE_UNCAL_GYRO +#include +#endif +#ifdef ENABLE_GRAVITY +#include +#endif +#ifdef ENABLE_LINEAR_ACCEL +#include +#endif +#ifdef ENABLE_RV +#include +#endif +#ifdef ENABLE_RV_RAW +#include +#endif + +#include + +extern "C" sensor_module* create(void) +{ + sensor_module *module = new(std::nothrow) sensor_module; + retvm_if(!module, NULL, "Failed to allocate memory"); + +#ifdef ENABLE_ACCEL + accel_sensor *accel_sensor_ptr = NULL; + try { + accel_sensor_ptr = new(std::nothrow) accel_sensor; + } catch (int err) { + ERR("Failed to create accel_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (accel_sensor_ptr != NULL) { + module->sensors.push_back(accel_sensor_ptr); + } +#endif + +#ifdef ENABLE_AUTO_ROTATION + auto_rotation_sensor *auto_rotation_sensor_ptr = NULL; + try { + auto_rotation_sensor_ptr = new(std::nothrow) auto_rotation_sensor; + } catch (int err) { + ERR("Failed to create auto_rotation_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (auto_rotation_sensor_ptr != NULL) + module->sensors.push_back(auto_rotation_sensor_ptr); +#endif + +#ifdef ENABLE_GYRO + gyro_sensor *gyro_sensor_ptr = NULL; + try { + gyro_sensor_ptr = new(std::nothrow) gyro_sensor; + } catch (int err) { + ERR("Failed to create gyro_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (gyro_sensor_ptr != NULL) + module->sensors.push_back(gyro_sensor_ptr); +#endif + +#ifdef ENABLE_PROXI + proxi_sensor *proxi_sensor_ptr = NULL; + try { + proxi_sensor_ptr = new(std::nothrow) proxi_sensor; + } catch (int err) { + ERR("Failed to create proxi_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (proxi_sensor_ptr != NULL) + module->sensors.push_back(proxi_sensor_ptr); +#endif + +#ifdef ENABLE_LIGHT + light_sensor *light_sensor_ptr = NULL; + try { + light_sensor_ptr = new(std::nothrow) light_sensor; + } catch (int err) { + ERR("Failed to create light_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (light_sensor_ptr != NULL) + module->sensors.push_back(light_sensor_ptr); +#endif + +#ifdef ENABLE_GEO + geo_sensor *geo_sensor_ptr = NULL; + try { + geo_sensor_ptr = new(std::nothrow) geo_sensor; + } catch (int err) { + ERR("Failed to create geo_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (geo_sensor_ptr != NULL) + module->sensors.push_back(geo_sensor_ptr); +#endif + +#ifdef ENABLE_PRESSURE + pressure_sensor *pressure_sensor_ptr = NULL; + try { + pressure_sensor_ptr = new(std::nothrow) pressure_sensor; + } catch (int err) { + ERR("Failed to create pressure_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (pressure_sensor_ptr != NULL) + module->sensors.push_back(pressure_sensor_ptr); +#endif + +#ifdef ENABLE_TEMPERATURE + temperature_sensor *temperature_sensor_ptr = NULL; + try { + temperature_sensor_ptr = new(std::nothrow) temperature_sensor; + } catch (int err) { + ERR("Failed to create temperature_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (temperature_sensor_ptr != NULL) + module->sensors.push_back(temperature_sensor_ptr); +#endif + +#ifdef ENABLE_ULTRAVIOLET + ultraviolet_sensor *ultraviolet_sensor_ptr = NULL; + try { + ultraviolet_sensor_ptr = new(std::nothrow) ultraviolet_sensor; + } catch (int err) { + ERR("Failed to create ultraviolet_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (ultraviolet_sensor_ptr != NULL) + module->sensors.push_back(ultraviolet_sensor_ptr); +#endif + +#ifdef DENABLE_SENSOR_FUSION + fusion_sensor *fusion_sensor_ptr = NULL; + try { + fusion_sensor_ptr = new(std::nothrow) fusion_sensor; + } catch (int err) { + ERR("Failed to create fusion_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (fusion_sensor_ptr != NULL) + module->sensors.push_back(fusion_sensor_ptr); +#endif + +#ifdef ENABLE_ORIENTATION + orientation_sensor *orientation_sensor_ptr = NULL; + try { + orientation_sensor_ptr = new(std::nothrow) orientation_sensor; + } catch (int err) { + ERR("Failed to create orientation_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (orientation_sensor_ptr != NULL) + module->sensors.push_back(orientation_sensor_ptr); +#endif + +#ifdef ENABLE_GRAVITY + gravity_sensor *gravity_sensor_ptr = NULL; + try { + gravity_sensor_ptr = new(std::nothrow) gravity_sensor; + } catch (int err) { + ERR("Failed to create gravity_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (gravity_sensor_ptr != NULL) + module->sensors.push_back(gravity_sensor_ptr); +#endif + +#ifdef ENABLE_LINEAR_ACCEL + linear_accel_sensor *linear_accel_sensor_ptr = NULL; + try { + linear_accel_sensor_ptr = new(std::nothrow) linear_accel_sensor; + } catch (int err) { + ERR("Failed to create linear_accel_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (linear_accel_sensor_ptr != NULL) + module->sensors.push_back(linear_accel_sensor_ptr); +#endif + +#ifdef ENABLE_GEOMAGNETIC_RV + geomagnetic_rv_sensor *geomagnetic_rv_sensor_ptr = NULL; + try { + geomagnetic_rv_sensor_ptr = new(std::nothrow) geomagnetic_rv_sensor; + } catch (int err) { + ERR("Failed to create geomagnetic_rv_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (geomagnetic_rv_sensor_ptr != NULL) + module->sensors.push_back(geomagnetic_rv_sensor_ptr); +#endif + +#ifdef ENABLE_GAMING_RV + gaming_rv_sensor *gaming_rv_sensor_ptr = NULL; + try { + gaming_rv_sensor_ptr = new(std::nothrow) gaming_rv_sensor; + } catch (int err) { + ERR("Failed to create gaming_rv_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (gaming_rv_sensor_ptr != NULL) + module->sensors.push_back(gaming_rv_sensor_ptr); +#endif + +#ifdef ENABLE_RV + rv_sensor *rv_sensor_ptr = NULL; + try { + rv_sensor_ptr = new(std::nothrow) rv_sensor; + } catch (int err) { + ERR("Failed to create rv_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (rv_sensor_ptr != NULL) + module->sensors.push_back(rv_sensor_ptr); +#endif + +#ifdef ENABLE_TILT + tilt_sensor *tilt_sensor_ptr = NULL; + try { + tilt_sensor_ptr = new(std::nothrow) tilt_sensor; + } catch (int err) { + ERR("Failed to create tilt_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (tilt_sensor_ptr != NULL) + module->sensors.push_back(tilt_sensor_ptr); +#endif + +#ifdef ENABLE_UNCAL_GYRO + uncal_gyro_sensor *uncal_gyro_sensor_ptr = NULL; + try { + uncal_gyro_sensor_ptr = new(std::nothrow) uncal_gyro_sensor; + } catch (int err) { + ERR("Failed to create uncal_gyro_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (uncal_gyro_sensor_ptr != NULL) + module->sensors.push_back(uncal_gyro_sensor_ptr); +#endif + +#ifdef ENABLE_BIO_LED_RED + bio_led_red_sensor *bio_led_red_sensor_ptr = NULL; + try { + bio_led_red_sensor_ptr = new(std::nothrow) bio_led_red_sensor; + } catch (int err) { + ERR("Failed to create bio_led_red_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (bio_led_red_sensor_ptr != NULL) + module->sensors.push_back(bio_led_red_sensor_ptr); +#endif + +#ifdef ENABLE_RV_RAW + rv_raw_sensor *rv_raw_sensor_ptr = NULL; + try { + rv_raw_sensor_ptr = new(std::nothrow) rv_raw_sensor; + } catch (int err) { + ERR("Failed to create rv_raw_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (rv_raw_sensor_ptr != NULL) + module->sensors.push_back(rv_raw_sensor_ptr); +#endif + + return module; +} -- 2.7.4 From f4996c391623825384dcb7e1345b354142ed3b9f Mon Sep 17 00:00:00 2001 From: Ramasamy Date: Thu, 12 Nov 2015 19:39:12 +0900 Subject: [PATCH 14/16] Fixing issues related to loading virtual sensors - fixing loader file for virtual sensors - cleanup Change-Id: Id290de293f8090a15790aaf94ee22e7aa6d93797 --- .gitignore | 2 ++ src/server/plugins/CMakeLists.txt | 28 +++++++++----------------- src/server/plugins/sensor_module_create.cpp.in | 5 ++++- 3 files changed, 15 insertions(+), 20 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..47bd4b3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.project +.cproject \ No newline at end of file diff --git a/src/server/plugins/CMakeLists.txt b/src/server/plugins/CMakeLists.txt index 8ce6ea5..839e40c 100755 --- a/src/server/plugins/CMakeLists.txt +++ b/src/server/plugins/CMakeLists.txt @@ -73,56 +73,37 @@ ENDIF() IF("${ORIENTATION}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") set(ORIENTATION_ENABLE "1") -add_definitions(-DENABLE_SENSOR_FUSION) -add_definitions(-DENABLE_ORIENTATION) ENDIF() IF("${RV}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") set(RV_ENABLE "1") -add_definitions(-DENABLE_SENSOR_FUSION) -add_definitions(-DENABLE_RV) ENDIF() IF("${GEOMAGNETIC_RV}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") set(GEOMAGNETIC_RV_ENABLE "1") -add_definitions(-DENABLE_SENSOR_FUSION) -add_definitions(-DENABLE_GEOMAGNETIC_RV) ENDIF() IF("${GAMING_RV}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") set(GAMING_RV_ENABLE "1") -add_definitions(-DENABLE_SENSOR_FUSION) -add_definitions(-DENABLE_GAMING_RV) ENDIF() IF("${TILT}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") set(TILT_ENABLE "1") -add_definitions(-DENABLE_SENSOR_FUSION) -add_definitions(-DENABLE_TILT) ENDIF() IF("${UNCAL_GYRO}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") set(UNCAL_GYRO_ENABLE "1") -add_definitions(-DENABLE_SENSOR_FUSION) -add_definitions(-DENABLE_UNCAL_GYRO) ENDIF() IF("${GRAVITY}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") set(ORIENTATION_ENABLE "1") set(GRAVITY_ENABLE "1") -add_definitions(-DENABLE_SENSOR_FUSION) -add_definitions(-DENABLE_ORIENTATION) -add_definitions(-DENABLE_GRAVITY) ENDIF() IF("${LINEAR_ACCEL}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") set(ORIENTATION_ENABLE "1") set(GRAVITY_ENABLE "1") set(LINEAR_ACCEL_ENABLE "1") -add_definitions(-DENABLE_SENSOR_FUSION) -add_definitions(-DENABLE_ORIENTATION) -add_definitions(-DENABLE_GRAVITY) -add_definitions(-DENABLE_LINEAR_ACCEL) ENDIF() IF("${SENSOR_FUSION_ENABLE}" STREQUAL "1") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/sensor_fusion) @@ -135,38 +116,47 @@ list (APPEND PLUGIN_SRCS "sensor_fusion/sensor_data.cpp") list (APPEND PLUGIN_SRCS "sensor_fusion/vector.cpp") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/fusion) list (APPEND PLUGIN_SRCS "fusion/fusion_sensor.cpp") +add_definitions(-DENABLE_SENSOR_FUSION) ENDIF() IF("${ORIENTATION_ENABLE}" STREQUAL "1") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/orientation) list (APPEND PLUGIN_SRCS "orientation/orientation_sensor.cpp") +add_definitions(-DENABLE_ORIENTATION) ENDIF() IF("${GRAVITY_ENABLE}" STREQUAL "1") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/gravity) list (APPEND PLUGIN_SRCS "gravity/gravity_sensor.cpp") +add_definitions(-DENABLE_GRAVITY) ENDIF() IF("${LINEAR_ACCEL_ENABLE}" STREQUAL "1") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/linear_accel) list (APPEND PLUGIN_SRCS "linear_accel/linear_accel_sensor.cpp") +add_definitions(-DENABLE_LINEAR_ACCEL) ENDIF() IF("${TILT_ENABLE}" STREQUAL "1") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/tilt) list (APPEND PLUGIN_SRCS "tilt/tilt_sensor.cpp") +add_definitions(-DENABLE_TILT) ENDIF() IF("${UNCAL_GYRO_ENABLE}" STREQUAL "1") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/uncal_gyro) list (APPEND PLUGIN_SRCS "uncal_gyro/uncal_gyro_sensor.cpp") +add_definitions(-DENABLE_UNCAL_GYRO) ENDIF() IF("${RV_ENABLE}" STREQUAL "1") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/rotation_vector/rv) list (APPEND PLUGIN_SRCS "rotation_vector/rv/rv_sensor.cpp") +add_definitions(-DENABLE_RV) ENDIF() IF("${GEOMAGNETIC_RV_ENABLE}" STREQUAL "1") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/rotation_vector/geomagnetic_rv) list (APPEND PLUGIN_SRCS "rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp") +add_definitions(-DENABLE_GEOMAGNETIC_RV) ENDIF() IF("${GAMING_RV_ENABLE}" STREQUAL "1") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/rotation_vector/gaming_rv) list (APPEND PLUGIN_SRCS "rotation_vector/gaming_rv/gaming_rv_sensor.cpp") +add_definitions(-DENABLE_GAMING_RV) ENDIF() IF("${RV_RAW}" STREQUAL "ON") include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/rotation_vector/rv_raw) diff --git a/src/server/plugins/sensor_module_create.cpp.in b/src/server/plugins/sensor_module_create.cpp.in index 2008bb5..780461b 100644 --- a/src/server/plugins/sensor_module_create.cpp.in +++ b/src/server/plugins/sensor_module_create.cpp.in @@ -28,6 +28,9 @@ #ifdef ENABLE_BIO_LED_RED #include #endif +#ifdef ENABLE_SENSOR_FUSION +#include +#endif #ifdef ENABLE_ORIENTATION #include #endif @@ -163,7 +166,7 @@ extern "C" sensor_module* create(void) module->sensors.push_back(ultraviolet_sensor_ptr); #endif -#ifdef DENABLE_SENSOR_FUSION +#ifdef ENABLE_SENSOR_FUSION fusion_sensor *fusion_sensor_ptr = NULL; try { fusion_sensor_ptr = new(std::nothrow) fusion_sensor; -- 2.7.4 From e8ba82885d1ad9ef076c0a84647245741d889bc8 Mon Sep 17 00:00:00 2001 From: Ankur Date: Mon, 16 Nov 2015 12:05:46 +0530 Subject: [PATCH 15/16] Fixing build issues for auto_rotation and rv_raw Tested auto_rotation on rd-pq Change-Id: Ie5fb189bdad77ec7544406072770f03fe3145d0d --- src/server/plugins/auto_rotation/auto_rotation_sensor.h | 1 + .../plugins/rotation_vector/rv_raw/rv_raw_sensor.cpp | 14 +++++++------- src/shared/sensor_types.h | 7 +++++++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/server/plugins/auto_rotation/auto_rotation_sensor.h b/src/server/plugins/auto_rotation/auto_rotation_sensor.h index d2d1998..f5bfceb 100755 --- a/src/server/plugins/auto_rotation/auto_rotation_sensor.h +++ b/src/server/plugins/auto_rotation/auto_rotation_sensor.h @@ -20,6 +20,7 @@ #ifndef _AUTO_ROTATION_SENSOR_H_ #define _AUTO_ROTATION_SENSOR_H_ +#include #include #include diff --git a/src/server/plugins/rotation_vector/rv_raw/rv_raw_sensor.cpp b/src/server/plugins/rotation_vector/rv_raw/rv_raw_sensor.cpp index 81b49fc..d617857 100755 --- a/src/server/plugins/rotation_vector/rv_raw/rv_raw_sensor.cpp +++ b/src/server/plugins/rotation_vector/rv_raw/rv_raw_sensor.cpp @@ -19,7 +19,7 @@ #include #include - +#include #include #include @@ -33,8 +33,8 @@ rv_raw_sensor::rv_raw_sensor() { m_name = string(SENSOR_NAME); - register_supported_event(RV_RAW_EVENT_RAW_DATA_REPORT_ON_TIME); - register_supported_event(RV_RAW_EVENT_CALIBRATION_NEEDED); + register_supported_event(RV_RAW_RAW_DATA_EVENT); + register_supported_event(RV_RAW_CALIBRATION_NEEDED_EVENT); physical_sensor::set_poller(rv_raw_sensor::working, this); } @@ -53,7 +53,7 @@ bool rv_raw_sensor::init() return false; } - sensor_properties_t properties; + sensor_properties_s properties; if (!m_sensor_hal->get_properties(properties)) { ERR("sensor->get_properties() is failed!\n"); @@ -90,9 +90,9 @@ bool rv_raw_sensor::process_event(void) AUTOLOCK(m_client_info_mutex); AUTOLOCK(m_mutex); - if (get_client_cnt(RV_RAW_EVENT_RAW_DATA_REPORT_ON_TIME)) { + if (get_client_cnt(RV_RAW_RAW_DATA_EVENT)) { event.sensor_id = get_id(); - event.event_type = RV_RAW_EVENT_RAW_DATA_REPORT_ON_TIME; + event.event_type = RV_RAW_RAW_DATA_EVENT; push(event); } @@ -128,7 +128,7 @@ int rv_raw_sensor::get_sensor_data(unsigned int type, sensor_data_t &data) { int state; - if (type != RV_RAW_BASE_DATA_SET) + if (type != RV_RAW_RAW_DATA_EVENT) return -1; state = m_sensor_hal->get_sensor_data(data); diff --git a/src/shared/sensor_types.h b/src/shared/sensor_types.h index 254213f..75e0e70 100644 --- a/src/shared/sensor_types.h +++ b/src/shared/sensor_types.h @@ -67,6 +67,13 @@ enum rot_event_type { ROTATION_VECTOR_RAW_DATA_EVENT = (ROTATION_VECTOR_SENSOR << 16) | 0x0001, }; +// Rotation Vector Raw +enum rv_raw_event_type { + RV_RAW_RAW_DATA_EVENT = (RV_RAW_SENSOR << 16) | 0x0001, + RV_RAW_CALIBRATION_NEEDED_EVENT = (RV_RAW_SENSOR << 16) | 0x0002 +}; + + // Ultraviolet enum ultraviolet_event_type { ULTRAVIOLET_RAW_DATA_EVENT = (ULTRAVIOLET_SENSOR << 16) | 0x0001, -- 2.7.4 From a768203400869bc0d7ba29499a64bac5fa93e0e4 Mon Sep 17 00:00:00 2001 From: Ankur Date: Tue, 17 Nov 2015 17:48:10 +0530 Subject: [PATCH 16/16] Removing Separate library for sensor-plugins, included it in sensord exec No Separate sensor-plugin library for sensord plugins, object files for sensor plugins now included in sensord exec. Updated the sensor_plugin loader as per new structure Change-Id: I03b18c148c00460c47de85fcbe3fa00a5b498213 --- packaging/sensord.spec | 32 +- src/server/CMakeLists.txt | 9 +- src/server/plugins/CMakeLists.txt | 172 ++++----- src/server/sensor_plugin_loader.cpp | 265 -------------- src/server/sensor_plugin_loader.cpp.in | 632 +++++++++++++++++++++++++++++++++ src/server/sensor_plugin_loader.h | 2 + 6 files changed, 720 insertions(+), 392 deletions(-) delete mode 100644 src/server/sensor_plugin_loader.cpp create mode 100644 src/server/sensor_plugin_loader.cpp.in diff --git a/packaging/sensord.spec b/packaging/sensord.spec index 03ab16a..cd89022 100644 --- a/packaging/sensord.spec +++ b/packaging/sensord.spec @@ -20,25 +20,15 @@ BuildRequires: pkgconfig(cynara-creds-socket) BuildRequires: pkgconfig(cynara-client) BuildRequires: pkgconfig(cynara-session) -%define accel_state ON %define auto_rotation_state OFF -%define gyro_state OFF -%define proxi_state OFF -%define light_state OFF -%define geo_state OFF -%define pressure_state OFF -%define temperature_state OFF -%define ultraviolet_state OFF %define orientation_state OFF %define gravity_state OFF %define linear_accel_state OFF %define rv_state OFF -%define rv_raw_state OFF %define geomagnetic_rv_state OFF %define gaming_rv_state OFF %define tilt_state OFF %define uncal_gyro_state OFF -%define bio_led_red_state OFF %define build_test_suite ON %description @@ -68,14 +58,6 @@ Requires: %{name} = %{version}-%{release} %description -n libsensord-devel Sensord shared library -%package -n libsensord-plugins -Summary: Sensord plugin library -Group: System/Development -Requires: %{name} = %{version}-%{release} - -%description -n libsensord-plugins -Sensord plugin library - %if %{build_test_suite} == "ON" %package -n sensor-test Summary: Sensord library @@ -92,15 +74,12 @@ Sensor functional testing cp %{SOURCE1} . cp %{SOURCE2} . -cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DACCEL=%{accel_state} \ - -DGYRO=%{gyro_state} -DPROXI=%{proxi_state} -DLIGHT=%{light_state} \ - -DGEO=%{geo_state} -DPRESSURE=%{pressure_state} -DTEMPERATURE=%{temperature_state} \ +cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DORIENTATION=%{orientation_state} -DGRAVITY=%{gravity_state} \ - -DLINEAR_ACCEL=%{linear_accel_state} -DRV=%{rv_state} -DRV_RAW=%{rv_raw_state} \ + -DLINEAR_ACCEL=%{linear_accel_state} -DRV=%{rv_state} \ -DGEOMAGNETIC_RV=%{geomagnetic_rv_state} -DGAMING_RV=%{gaming_rv_state} \ -DUNCAL_GYRO=%{uncal_gyro_state} -DAUTO_ROTATION=%{auto_rotation_state} \ - -DTILT=%{tilt_state} -DULTRAVIOLET=%{ultraviolet_state} \ - -DBIO_LED_RED=%{bio_led_red_state} -DTEST_SUITE=%{build_test_suite} \ + -DTILT=%{tilt_state} -DTEST_SUITE=%{build_test_suite} \ -DLIBDIR=%{_libdir} -DINCLUDEDIR=%{_includedir} %build @@ -148,11 +127,6 @@ systemctl daemon-reload %{_libdir}/pkgconfig/sensor.pc %license LICENSE.APLv2 -%files -n libsensord-plugins -%defattr(-,root,root,-) -%{_libdir}/libsensord-plugins.so -%license LICENSE.APLv2 - %if %{build_test_suite} == "ON" %files -n sensor-test %defattr(-,root,root,-) diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt index a95f2a6..30a5eff 100755 --- a/src/server/CMakeLists.txt +++ b/src/server/CMakeLists.txt @@ -6,6 +6,10 @@ PKG_CHECK_MODULES(server_pkgs REQUIRED glib-2.0 gio-2.0 dlog libsystemd-daemon l add_subdirectory(plugins) +add_definitions(${PLUGIN_DEFS}) + +configure_file(sensor_plugin_loader.cpp.in sensor_plugin_loader.cpp) + INCLUDE_DIRECTORIES(include) FILE(GLOB SERVER_SRCS *.c *.cpp) @@ -20,12 +24,13 @@ ENDFOREACH(flag) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/client) include_directories(${CMAKE_SOURCE_DIR}/src/shared) +include_directories(${DIR_INCLUDE}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lrt -ldl -pthread -fPIE") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie") -add_executable(${PROJECT_NAME} ${SERVER_SRCS}) +add_executable(${PROJECT_NAME} ${SERVER_SRCS} ${PLUGIN_SRCS}) target_link_libraries(${PROJECT_NAME} ${lib_pkgs_LDFLAGS} "sensord-devel") -install(TARGETS ${PROJECT_NAME} DESTINATION bin) +install(TARGETS ${PROJECT_NAME} DESTINATION bin) \ No newline at end of file diff --git a/src/server/plugins/CMakeLists.txt b/src/server/plugins/CMakeLists.txt index 839e40c..971fe9b 100755 --- a/src/server/plugins/CMakeLists.txt +++ b/src/server/plugins/CMakeLists.txt @@ -18,58 +18,42 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src/server) include_directories(${CMAKE_SOURCE_DIR}/src/shared) -IF("${ACCEL}" STREQUAL "ON") -include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/accel) -list (APPEND PLUGIN_SRCS "accel/accel_sensor.cpp") -add_definitions(-DENABLE_ACCEL) -ENDIF() -IF("${GYRO}" STREQUAL "ON") -include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/gyro) -list (APPEND PLUGIN_SRCS "gyro/gyro_sensor.cpp") -add_definitions(-DENABLE_GYRO) -ENDIF() -IF("${PROXI}" STREQUAL "ON") -include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/proxi) -list (APPEND PLUGIN_SRCS "proxi/proxi_sensor.cpp") -add_definitions(-DENABLE_PROXI) -ENDIF() -IF("${LIGHT}" STREQUAL "ON") -include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/light) -list (APPEND PLUGIN_SRCS "light/light_sensor.cpp") -add_definitions(-DENABLE_LIGHT) -ENDIF() -IF("${GEO}" STREQUAL "ON") -include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/geo) -list (APPEND PLUGIN_SRCS "geo/geo_sensor.cpp") -add_definitions(-DENABLE_GEO) -ENDIF() + +list (APPEND DIR_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/accel") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/accel/accel_sensor.cpp") + +list (APPEND DIR_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/gyro") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/gyro/gyro_sensor.cpp") + +list (APPEND DIR_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/proxi") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/proxi/proxi_sensor.cpp") + +list (APPEND DIR_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/light") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/light/light_sensor.cpp") + +list (APPEND DIR_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/geo") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/geo/geo_sensor.cpp") + IF("${AUTO_ROTATION}" STREQUAL "ON") -include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/auto_rotation) -list (APPEND PLUGIN_SRCS "auto_rotation/auto_rotation_alg.cpp") -list (APPEND PLUGIN_SRCS "auto_rotation/auto_rotation_alg_emul.cpp") -list (APPEND PLUGIN_SRCS "auto_rotation/auto_rotation_sensor.cpp") -add_definitions(-DENABLE_AUTO_ROTATION) -ENDIF() -IF("${PRESSURE}" STREQUAL "ON") -include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/pressure) -list (APPEND PLUGIN_SRCS "pressure/pressure_sensor.cpp") -add_definitions(-DENABLE_PRESSURE) -ENDIF() -IF("${TEMPERATURE}" STREQUAL "ON") -include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/temperature) -list (APPEND PLUGIN_SRCS "temperature/temperature_sensor.cpp") -add_definitions(-DENABLE_TEMPERATURE) -ENDIF() -IF("${ULTRAVIOLET}" STREQUAL "ON") -include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/ultraviolet) -list (APPEND PLUGIN_SRCS "ultraviolet/ultraviolet_sensor.cpp") -add_definitions(-DENABLE_ULTRAVIOLET) -ENDIF() -IF("${BIO_LED_RED}" STREQUAL "ON") -include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/bio_led_red) -list (APPEND PLUGIN_SRCS "bio_led_red/bio_led_red_sensor.cpp") -add_definitions(-DENABLE_BIO_LED_RED) +list (APPEND DIR_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/auto_rotation") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/auto_rotation/auto_rotation_alg.cpp") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/auto_rotation/auto_rotation_alg_emul.cpp") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/auto_rotation/auto_rotation_sensor.cpp") +list (APPEND PLUGIN_DEFS "-DENABLE_AUTO_ROTATION") ENDIF() + +list (APPEND DIR_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/pressure") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/pressure/pressure_sensor.cpp") + +list (APPEND DIR_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/temperature") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/temperature/temperature_sensor.cpp") + +list (APPEND DIR_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/ultraviolet") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/ultraviolet/ultraviolet_sensor.cpp") + +list (APPEND DIR_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/bio_led_red") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/bio_led_red/bio_led_red_sensor.cpp") + IF("${ORIENTATION}" STREQUAL "ON") set(SENSOR_FUSION_ENABLE "1") set(ORIENTATION_ENABLE "1") @@ -105,71 +89,67 @@ set(ORIENTATION_ENABLE "1") set(GRAVITY_ENABLE "1") set(LINEAR_ACCEL_ENABLE "1") ENDIF() + IF("${SENSOR_FUSION_ENABLE}" STREQUAL "1") -include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/sensor_fusion) -list (APPEND PLUGIN_SRCS "sensor_fusion/euler_angles.cpp") -list (APPEND PLUGIN_SRCS "sensor_fusion/matrix.cpp") -list (APPEND PLUGIN_SRCS "sensor_fusion/orientation_filter.cpp") -list (APPEND PLUGIN_SRCS "sensor_fusion/quaternion.cpp") -list (APPEND PLUGIN_SRCS "sensor_fusion/rotation_matrix.cpp") -list (APPEND PLUGIN_SRCS "sensor_fusion/sensor_data.cpp") -list (APPEND PLUGIN_SRCS "sensor_fusion/vector.cpp") -include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/fusion) -list (APPEND PLUGIN_SRCS "fusion/fusion_sensor.cpp") -add_definitions(-DENABLE_SENSOR_FUSION) +list (APPEND DIR_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/sensor_fusion") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/sensor_fusion/euler_angles.cpp") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/sensor_fusion/matrix.cpp") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/sensor_fusion/orientation_filter.cpp") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/sensor_fusion/quaternion.cpp") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/sensor_fusion/rotation_matrix.cpp") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/sensor_fusion/sensor_data.cpp") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/sensor_fusion/vector.cpp") +list (APPEND DIR_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/fusion") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/fusion/fusion_sensor.cpp") +list (APPEND PLUGIN_DEFS "-DENABLE_SENSOR_FUSION") ENDIF() + IF("${ORIENTATION_ENABLE}" STREQUAL "1") -include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/orientation) -list (APPEND PLUGIN_SRCS "orientation/orientation_sensor.cpp") -add_definitions(-DENABLE_ORIENTATION) +list (APPEND DIR_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/orientation") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/orientation/orientation_sensor.cpp") +list (APPEND PLUGIN_DEFS "-DENABLE_ORIENTATION") ENDIF() IF("${GRAVITY_ENABLE}" STREQUAL "1") -include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/gravity) -list (APPEND PLUGIN_SRCS "gravity/gravity_sensor.cpp") -add_definitions(-DENABLE_GRAVITY) +list (APPEND DIR_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/gravity") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/gravity/gravity_sensor.cpp") +list (APPEND PLUGIN_DEFS "-DENABLE_GRAVITY") ENDIF() IF("${LINEAR_ACCEL_ENABLE}" STREQUAL "1") -include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/linear_accel) -list (APPEND PLUGIN_SRCS "linear_accel/linear_accel_sensor.cpp") -add_definitions(-DENABLE_LINEAR_ACCEL) +list (APPEND DIR_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/linear_accel") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/linear_accel/linear_accel_sensor.cpp") +list (APPEND PLUGIN_DEFS "-DENABLE_LINEAR_ACCEL") ENDIF() IF("${TILT_ENABLE}" STREQUAL "1") -include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/tilt) -list (APPEND PLUGIN_SRCS "tilt/tilt_sensor.cpp") -add_definitions(-DENABLE_TILT) +list (APPEND DIR_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/tilt") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/tilt/tilt_sensor.cpp") +list (APPEND PLUGIN_DEFS "-DENABLE_TILT") ENDIF() IF("${UNCAL_GYRO_ENABLE}" STREQUAL "1") -include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/uncal_gyro) -list (APPEND PLUGIN_SRCS "uncal_gyro/uncal_gyro_sensor.cpp") -add_definitions(-DENABLE_UNCAL_GYRO) +list (APPEND DIR_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/uncal_gyro") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/uncal_gyro/uncal_gyro_sensor.cpp") +list (APPEND PLUGIN_DEFS "-DENABLE_UNCAL_GYRO") ENDIF() IF("${RV_ENABLE}" STREQUAL "1") -include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/rotation_vector/rv) -list (APPEND PLUGIN_SRCS "rotation_vector/rv/rv_sensor.cpp") -add_definitions(-DENABLE_RV) +list (APPEND DIR_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/rotation_vector/rv") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/rotation_vector/rv/rv_sensor.cpp") +list (APPEND PLUGIN_DEFS "-DENABLE_RV") ENDIF() IF("${GEOMAGNETIC_RV_ENABLE}" STREQUAL "1") -include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/rotation_vector/geomagnetic_rv) -list (APPEND PLUGIN_SRCS "rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp") -add_definitions(-DENABLE_GEOMAGNETIC_RV) +list (APPEND DIR_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/rotation_vector/geomagnetic_rv") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp") +list (APPEND PLUGIN_DEFS "-DENABLE_GEOMAGNETIC_RV") ENDIF() IF("${GAMING_RV_ENABLE}" STREQUAL "1") -include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/rotation_vector/gaming_rv) -list (APPEND PLUGIN_SRCS "rotation_vector/gaming_rv/gaming_rv_sensor.cpp") -add_definitions(-DENABLE_GAMING_RV) -ENDIF() -IF("${RV_RAW}" STREQUAL "ON") -include_directories(${CMAKE_SOURCE_DIR}/src/server/plugins/rotation_vector/rv_raw) -list (APPEND PLUGIN_SRCS "rotation_vector/rv_raw/rv_raw_sensor.cpp") +list (APPEND DIR_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/rotation_vector/gaming_rv") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/rotation_vector/gaming_rv/gaming_rv_sensor.cpp") +list (APPEND PLUGIN_DEFS "-DENABLE_GAMING_RV") ENDIF() -configure_file(sensor_module_create.cpp.in sensor_module_create.cpp) +list (APPEND DIR_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/rotation_vector/rv_raw") +list (APPEND PLUGIN_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/rotation_vector/rv_raw/rv_raw_sensor.cpp") -add_library(${PROJECT_NAME} SHARED - sensor_module_create.cpp - ${PLUGIN_SRCS} - ) -target_link_libraries(${PROJECT_NAME} ${plugin_pkgs_LDFLAGS} "-lrt -ldl -pthread") +set(PLUGIN_SRCS ${PLUGIN_SRCS} PARENT_SCOPE) +set(DIR_INCLUDE ${DIR_INCLUDE} PARENT_SCOPE) +set(PLUGIN_DEFS ${PLUGIN_DEFS} PARENT_SCOPE) -install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}) \ No newline at end of file diff --git a/src/server/sensor_plugin_loader.cpp b/src/server/sensor_plugin_loader.cpp deleted file mode 100644 index 42187c6..0000000 --- a/src/server/sensor_plugin_loader.cpp +++ /dev/null @@ -1,265 +0,0 @@ -/* - * libsensord-share - * - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using std::make_pair; -using std::equal; -using std::unordered_set; -using std::pair; -using std::vector; -using std::string; -using std::shared_ptr; -using std::static_pointer_cast; - -#define ROOT_ELEMENT "PLUGIN" -#define TEXT_ELEMENT "text" -#define PATH_ATTR "path" -#define HAL_ELEMENT "HAL" -#define SENSOR_ELEMENT "SENSOR" - -#define SENSOR_PLUGINS_DIR_PATH "/usr/lib/libsensord-plugins.so" -#define HAL_PLUGINS_DIR_PATH "/usr/lib/libsensor-hal.so" - -#define SENSOR_INDEX_SHIFT 16 - -sensor_plugin_loader::sensor_plugin_loader() -{ -} - -sensor_plugin_loader& sensor_plugin_loader::get_instance() -{ - static sensor_plugin_loader inst; - return inst; -} - -bool sensor_plugin_loader::load_module(const string &path, vector &sensors, void* &handle) -{ - void *_handle = dlopen(path.c_str(), RTLD_NOW); - - if (!_handle) { - ERR("Failed to dlopen(%s), dlerror : %s", path.c_str(), dlerror()); - return false; - } - - dlerror(); - - create_t create_module = (create_t) dlsym(_handle, "create"); - - if (!create_module) { - ERR("Failed to find symbols in %s", path.c_str()); - dlclose(_handle); - return false; - } - - sensor_module *module = create_module(); - - if (!module) { - ERR("Failed to create module, path is %s\n", path.c_str()); - dlclose(_handle); - return false; - } - - sensors.clear(); - sensors.swap(module->sensors); - - delete module; - handle = _handle; - - return true; -} - -bool sensor_plugin_loader::insert_module(plugin_type type, const string &path) -{ - if (type == PLUGIN_TYPE_HAL) { - DBG("Insert HAL plugin [%s]", path.c_str()); - - std::vectorhals; - void *handle; - - if (!load_module(path, hals, handle)) - return false; - - shared_ptr hal; - - for (unsigned int i = 0; i < hals.size(); ++i) { - hal.reset(static_cast (hals[i])); - sensor_hal_type_t sensor_hal_type = hal->get_type(); - m_sensor_hals.insert(make_pair(sensor_hal_type, hal)); - } - } else if (type == PLUGIN_TYPE_SENSOR) { - DBG("Insert Sensor plugin [%s]", path.c_str()); - - std::vector sensors; - void *handle; - - if (!load_module(path, sensors, handle)) - return false; - - shared_ptr sensor; - - for (unsigned int i = 0; i < sensors.size(); ++i) { - sensor.reset(static_cast (sensors[i])); - - if (!sensor->init()) { - ERR("Failed to init [%s] module\n", sensor->get_name()); - continue; - } - - DBG("init [%s] module", sensor->get_name()); - - vector sensor_types; - - sensor->get_types(sensor_types); - - for (unsigned int i = 0; i < sensor_types.size(); ++i) { - int idx; - idx = m_sensors.count(sensor_types[i]); - sensor->add_id(idx << SENSOR_INDEX_SHIFT | sensor_types[i]); - m_sensors.insert(make_pair(sensor_types[i], sensor)); - } - } - }else { - ERR("Not supported type: %d", type); - return false; - } - - return true; -} - -bool sensor_plugin_loader::load_plugins(void) -{ - insert_module(PLUGIN_TYPE_HAL, HAL_PLUGINS_DIR_PATH); - insert_module(PLUGIN_TYPE_SENSOR, SENSOR_PLUGINS_DIR_PATH); - - show_sensor_info(); - return true; -} - -void sensor_plugin_loader::show_sensor_info(void) -{ - INFO("========== Loaded sensor information ==========\n"); - - int index = 0; - - auto it = m_sensors.begin(); - - while (it != m_sensors.end()) { - shared_ptr sensor = it->second; - - sensor_info info; - sensor->get_sensor_info(it->first, info); - INFO("No:%d [%s]\n", ++index, sensor->get_name()); - info.show(); - it++; - } - - INFO("===============================================\n"); -} - -sensor_hal* sensor_plugin_loader::get_sensor_hal(sensor_hal_type_t type) -{ - auto it_plugins = m_sensor_hals.find(type); - - if (it_plugins == m_sensor_hals.end()) - return NULL; - - return it_plugins->second.get(); -} - -vector sensor_plugin_loader::get_sensor_hals(sensor_hal_type_t type) -{ - vector sensor_hal_list; - pair ret; - ret = m_sensor_hals.equal_range(type); - - for (auto it = ret.first; it != ret.second; ++it) - sensor_hal_list.push_back(it->second.get()); - - return sensor_hal_list; -} - -sensor_base* sensor_plugin_loader::get_sensor(sensor_type_t type) -{ - auto it_plugins = m_sensors.find(type); - - if (it_plugins == m_sensors.end()) - return NULL; - - return it_plugins->second.get(); -} - -vector sensor_plugin_loader::get_sensors(sensor_type_t type) -{ - vector sensor_list; - pair ret; - - if (type == ALL_SENSOR) - ret = std::make_pair(m_sensors.begin(), m_sensors.end()); - else - ret = m_sensors.equal_range(type); - - for (auto it = ret.first; it != ret.second; ++it) - sensor_list.push_back(it->second.get()); - - return sensor_list; -} - - -sensor_base* sensor_plugin_loader::get_sensor(sensor_id_t id) -{ - vector sensors; - - sensor_type_t type = (sensor_type_t) (id & SENSOR_TYPE_MASK); - unsigned int index = id >> SENSOR_INDEX_SHIFT; - - sensors = get_sensors(type); - - if (sensors.size() <= index) - return NULL; - - return sensors[index]; -} - - -vector sensor_plugin_loader::get_virtual_sensors(void) -{ - vector virtual_list; - sensor_base* module; - - for (auto sensor_it = m_sensors.begin(); sensor_it != m_sensors.end(); ++sensor_it) { - module = sensor_it->second.get(); - - if (module && module->is_virtual() == true) { - virtual_list.push_back(module); - } - } - - return virtual_list; -} - diff --git a/src/server/sensor_plugin_loader.cpp.in b/src/server/sensor_plugin_loader.cpp.in new file mode 100644 index 0000000..c1c09f2 --- /dev/null +++ b/src/server/sensor_plugin_loader.cpp.in @@ -0,0 +1,632 @@ +/* + * libsensord-share + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef ENABLE_AUTO_ROTATION +#include +#endif +#ifdef ENABLE_TILT +#include +#endif +#ifdef ENABLE_GRAVITY +#include +#endif +#ifdef ENABLE_SENSOR_FUSION +#include +#endif +#ifdef ENABLE_LINEAR_ACCEL +#include +#endif +#ifdef ENABLE_ORIENTATION +#include +#endif +#ifdef ENABLE_GAMING_RV +#include +#endif +#ifdef ENABLE_GEOMAGNETIC_RV +#include +#endif +#ifdef ENABLE_RV +#include +#endif +#ifdef ENABLE_UNCAL_GYRO +#include +#endif + + +using std::make_pair; +using std::equal; +using std::unordered_set; +using std::pair; +using std::vector; +using std::string; +using std::shared_ptr; +using std::static_pointer_cast; + +#define ROOT_ELEMENT "PLUGIN" +#define TEXT_ELEMENT "text" +#define PATH_ATTR "path" +#define HAL_ELEMENT "HAL" +#define SENSOR_ELEMENT "SENSOR" + +#define ACCELEROMETER_ENABLED 0x01 +#define GYROSCOPE_ENABLED 0x02 +#define GEOMAGNETIC_ENABLED 0x04 +#define TILT_ENABLED 1 +#define FUSION_ENABLED 1 +#define AUTO_ROTATION_ENABLED 1 +#define GAMING_RV_ENABLED 3 +#define GEOMAGNETIC_RV_ENABLED 5 +#define ORIENTATION_ENABLED 7 +#define GRAVITY_ENABLED 7 +#define LINEAR_ACCEL_ENABLED 7 +#define ORIENTATION_ENABLED 7 + +#define HAL_PLUGINS_DIR_PATH "/usr/lib/sensor-hal" + +#define SENSOR_INDEX_SHIFT 16 + +sensor_plugin_loader::sensor_plugin_loader() +{ +} + +sensor_plugin_loader& sensor_plugin_loader::get_instance() +{ + static sensor_plugin_loader inst; + return inst; +} + +bool sensor_plugin_loader::load_module(const string &path, vector &sensors, void* &handle) +{ + void *_handle = dlopen(path.c_str(), RTLD_NOW); + + if (!_handle) { + ERR("Failed to dlopen(%s), dlerror : %s", path.c_str(), dlerror()); + return false; + } + + dlerror(); + + create_t create_module = (create_t) dlsym(_handle, "create"); + + if (!create_module) { + ERR("Failed to find symbols in %s", path.c_str()); + dlclose(_handle); + return false; + } + + sensor_module *module = create_module(); + + if (!module) { + ERR("Failed to create module, path is %s\n", path.c_str()); + dlclose(_handle); + return false; + } + + sensors.clear(); + sensors.swap(module->sensors); + + delete module; + handle = _handle; + + return true; +} + +bool sensor_plugin_loader::insert_module(plugin_type type, const string &path) +{ + if (type == PLUGIN_TYPE_HAL) { + DBG("Insert HAL plugin [%s]", path.c_str()); + + std::vectorhals; + void *handle; + + if (!load_module(path, hals, handle)) + return false; + + shared_ptr hal; + + for (unsigned int i = 0; i < hals.size(); ++i) { + hal.reset(static_cast (hals[i])); + sensor_hal_type_t sensor_hal_type = hal->get_type(); + m_sensor_hals.insert(make_pair(sensor_hal_type, hal)); + } + } else if (type == PLUGIN_TYPE_SENSOR) { + DBG("Insert Sensor plugin [%s]", path.c_str()); + + std::vector sensors; + void *handle; + + if (!load_module(path, sensors, handle)) + return false; + + shared_ptr sensor; + + for (unsigned int i = 0; i < sensors.size(); ++i) { + sensor.reset(static_cast (sensors[i])); + + if (!sensor->init()) { + ERR("Failed to init [%s] module\n", sensor->get_name()); + continue; + } + + DBG("init [%s] module", sensor->get_name()); + + vector sensor_types; + + sensor->get_types(sensor_types); + + for (unsigned int i = 0; i < sensor_types.size(); ++i) { + int idx; + idx = m_sensors.count(sensor_types[i]); + sensor->add_id(idx << SENSOR_INDEX_SHIFT | sensor_types[i]); + m_sensors.insert(make_pair(sensor_types[i], sensor)); + } + } + }else { + ERR("Not supported type: %d", type); + return false; + } + + return true; +} + +bool sensor_plugin_loader::load_plugins(void) +{ + vector hal_paths; + vector unique_hal_paths; + + int enable_virtual_sensor = 0; + vector sensors; + + get_paths_from_dir(string(HAL_PLUGINS_DIR_PATH), hal_paths); + + unordered_set s; + auto unique = [&s](vector &paths, const string &path) { + if (s.insert(path).second) + paths.push_back(path); + }; + + for_each(hal_paths.begin(), hal_paths.end(), + [&](const string &path) { + unique(unique_hal_paths, path); + } + ); + + for_each(unique_hal_paths.begin(), unique_hal_paths.end(), + [&](const string &path) { + insert_module(PLUGIN_TYPE_HAL, path); + } + ); + + + sensor_hal *accel_hal = get_sensor_hal(SENSOR_HAL_TYPE_ACCELEROMETER); + if (accel_hal != NULL) { + enable_virtual_sensor |= ACCELEROMETER_ENABLED; + + accel_sensor* accel_sensor_ptr = NULL; + try { + accel_sensor_ptr = new(std::nothrow) accel_sensor; + } catch (int err) { + ERR("Failed to create accel_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (accel_sensor_ptr != NULL) + sensors.push_back(accel_sensor_ptr); + } + + sensor_hal *gyro_hal = get_sensor_hal(SENSOR_HAL_TYPE_GYROSCOPE); + if (gyro_hal != NULL) { + enable_virtual_sensor |= GYROSCOPE_ENABLED; + + gyro_sensor* gyro_sensor_ptr = NULL; + try { + gyro_sensor_ptr = new(std::nothrow) gyro_sensor; + } catch (int err) { + ERR("Failed to create gyro_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (gyro_sensor_ptr != NULL) + sensors.push_back(gyro_sensor_ptr); + } + + sensor_hal *geo_hal = get_sensor_hal(SENSOR_HAL_TYPE_GEOMAGNETIC); + if (geo_hal != NULL) { + enable_virtual_sensor |= GEOMAGNETIC_ENABLED; + + geo_sensor* geo_sensor_ptr = NULL; + try { + geo_sensor_ptr = new(std::nothrow) geo_sensor; + } catch (int err) { + ERR("Failed to create geo_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (geo_sensor_ptr != NULL) + sensors.push_back(geo_sensor_ptr); + } +#ifdef ENABLE_SENSOR_FUSION + fusion_sensor* fusion_sensor_ptr = NULL; + try { + fusion_sensor_ptr = new(std::nothrow) fusion_sensor; + } catch (int err) { + ERR("Failed to create fusion_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (fusion_sensor_ptr != NULL) + sensors.push_back(fusion_sensor_ptr); +#endif +#ifdef ENABLE_TILT + if (enable_virtual_sensor & TILT_ENABLED == TILT_ENABLED) { + tilt_sensor* tilt_sensor_ptr = NULL; + try { + tilt_sensor_ptr = new(std::nothrow) tilt_sensor; + } catch (int err) { + ERR("Failed to create tilt_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (tilt_sensor_ptr != NULL) + sensors.push_back(tilt_sensor_ptr); + } +#endif +#ifdef ENABLE_AUTO_ROTATION + if (enable_virtual_sensor & AUTO_ROTATION_ENABLED == AUTO_ROTATION_ENABLED) { + auto_rotation_sensor* auto_rot_sensor_ptr = NULL; + try { + auto_rot_sensor_ptr = new(std::nothrow) auto_rotation_sensor; + } catch (int err) { + ERR("Failed to create auto_rotation_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (auto_rot_sensor_ptr != NULL) + sensors.push_back(auto_rot_sensor_ptr); + } +#endif +#ifdef ENABLE_GRAVITY + if (enable_virtual_sensor & GRAVITY_ENABLED == GRAVITY_ENABLED) { + gravity_sensor* gravity_sensor_ptr = NULL; + try { + gravity_sensor_ptr = new(std::nothrow) gravity_sensor; + } catch (int err) { + ERR("Failed to create tilt_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (gravity_sensor_ptr != NULL) + sensors.push_back(gravity_sensor_ptr); + } +#endif +#ifdef ENABLE_LINEAR_ACCEL + if (enable_virtual_sensor & LINEAR_ACCEL_ENABLED == LINEAR_ACCEL_ENABLED) { + linear_accel_sensor* linear_accel_sensor_ptr = NULL; + try { + linear_accel_sensor_ptr = new(std::nothrow) linear_accel_sensor; + } catch (int err) { + ERR("Failed to create linear_accel_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (linear_accel_sensor_ptr != NULL) + sensors.push_back(linear_accel_sensor_ptr); + } +#endif + + if (enable_virtual_sensor & ORIENTATION_ENABLED == ORIENTATION_ENABLED) { +#ifdef ENABLE_ORIENTATION + orientation_sensor* orientation_sensor_ptr = NULL; + try { + orientation_sensor_ptr = new(std::nothrow) orientation_sensor; + } catch (int err) { + ERR("Failed to create orientation_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (orientation_sensor_ptr != NULL) + sensors.push_back(orientation_sensor_ptr); +#endif +#ifdef ENABLE_RV + rv_sensor* rv_sensor_ptr = NULL; + try { + rv_sensor_ptr = new(std::nothrow) rv_sensor; + } catch (int err) { + ERR("Failed to create rv_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (rv_sensor_ptr != NULL) + sensors.push_back(rv_sensor_ptr); +#endif +#ifdef ENABLE_UNCAL_GYRO + uncal_gyro_sensor* uncal_gyro_sensor_ptr = NULL; + try { + uncal_gyro_sensor_ptr = new(std::nothrow) uncal_gyro_sensor; + } catch (int err) { + ERR("Failed to create uncal_gyro_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (uncal_gyro_sensor_ptr != NULL) + sensors.push_back(uncal_gyro_sensor_ptr); +#endif + } + +#ifdef ENABLE_GAMING_RV + if (enable_virtual_sensor & GAMING_RV_ENABLED == GAMING_RV_ENABLED) { + gaming_rv_sensor* gaming_rv_sensor_ptr = NULL; + try { + gaming_rv_sensor_ptr = new(std::nothrow) gaming_rv_sensor; + } catch (int err) { + ERR("Failed to create gaming_rv_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (gaming_rv_sensor_ptr != NULL) + sensors.push_back(gaming_rv_sensor_ptr); + } +#endif +#ifdef ENABLE_GEOMAGNETIC_RV + if (enable_virtual_sensor & GEOMAGNETIC_RV_ENABLED == GEOMAGNETIC_RV_ENABLED) { + geomagnetic_rv_sensor* geomagnetic_rv_sensor_ptr = NULL; + try { + geomagnetic_rv_sensor_ptr = new(std::nothrow) geomagnetic_rv_sensor; + } catch (int err) { + ERR("Failed to create geomagnetic_rv_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (geomagnetic_rv_sensor_ptr != NULL) + sensors.push_back(geomagnetic_rv_sensor_ptr); + } +#endif + sensor_hal *light_hal = get_sensor_hal(SENSOR_HAL_TYPE_LIGHT); + if (light_hal != NULL) { + light_sensor* light_sensor_ptr = NULL; + try { + light_sensor_ptr = new(std::nothrow) light_sensor; + } catch (int err) { + ERR("Failed to create light_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (light_sensor_ptr != NULL) + sensors.push_back(light_sensor_ptr); + } + + sensor_hal *proxi_hal = get_sensor_hal(SENSOR_HAL_TYPE_PROXIMITY); + if (proxi_hal != NULL) { + proxi_sensor* proxi_sensor_ptr = NULL; + try { + proxi_sensor_ptr = new(std::nothrow) proxi_sensor; + } catch (int err) { + ERR("Failed to create proxi_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (proxi_sensor_ptr != NULL) + sensors.push_back(proxi_sensor_ptr); + } + + sensor_hal *pressure_hal = get_sensor_hal(SENSOR_HAL_TYPE_PRESSURE); + if (pressure_hal != NULL) { + pressure_sensor* pressure_sensor_ptr = NULL; + try { + pressure_sensor_ptr = new(std::nothrow) pressure_sensor; + } catch (int err) { + ERR("Failed to create pressure_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (pressure_sensor_ptr != NULL) + sensors.push_back(pressure_sensor_ptr); + } + + sensor_hal *temp_hal = get_sensor_hal(SENSOR_HAL_TYPE_TEMPERATURE); + if (temp_hal != NULL) { + temperature_sensor* temp_sensor_ptr = NULL; + try { + temp_sensor_ptr = new(std::nothrow) temperature_sensor; + } catch (int err) { + ERR("Failed to create temperature_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (temp_sensor_ptr != NULL) + sensors.push_back(temp_sensor_ptr); + } + + sensor_hal *ultra_hal = get_sensor_hal(SENSOR_HAL_TYPE_ULTRAVIOLET); + if (ultra_hal != NULL) { + ultraviolet_sensor* ultra_sensor_ptr = NULL; + try { + ultra_sensor_ptr = new(std::nothrow) ultraviolet_sensor; + } catch (int err) { + ERR("Failed to create ultraviolet_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (ultra_sensor_ptr != NULL) + sensors.push_back(ultra_sensor_ptr); + } + + sensor_hal *bio_led_red_hal = get_sensor_hal(SENSOR_HAL_TYPE_BIO_LED_RED); + if (bio_led_red_hal != NULL) { + bio_led_red_sensor* bio_led_red_sensor_ptr = NULL; + try { + bio_led_red_sensor_ptr = new(std::nothrow) bio_led_red_sensor; + } catch (int err) { + ERR("Failed to create bio_led_red_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (bio_led_red_sensor_ptr != NULL) + sensors.push_back(bio_led_red_sensor_ptr); + } + + sensor_hal *rv_raw_hal = get_sensor_hal(SENSOR_HAL_TYPE_RV_RAW); + if (rv_raw_hal != NULL) { + rv_raw_sensor* rv_raw_sensor_ptr = NULL; + try { + rv_raw_sensor_ptr = new(std::nothrow) rv_raw_sensor; + } catch (int err) { + ERR("Failed to create rv_raw_sensor module, err: %d, cause: %s", err, strerror(err)); + } + if (rv_raw_sensor_ptr != NULL) + sensors.push_back(rv_raw_sensor_ptr); + } + + shared_ptr sensor; + + for (unsigned int i = 0; i < sensors.size(); ++i) { + sensor.reset(static_cast (sensors[i])); + + if (!sensor->init()) { + ERR("Failed to init [%s] module\n", sensor->get_name()); + continue; + } + + DBG("init [%s] module", sensor->get_name()); + + vector sensor_types; + + sensor->get_types(sensor_types); + + for (unsigned int i = 0; i < sensor_types.size(); ++i) { + int idx; + idx = m_sensors.count(sensor_types[i]); + sensor->add_id(idx << SENSOR_INDEX_SHIFT | sensor_types[i]); + m_sensors.insert(make_pair(sensor_types[i], sensor)); + } + } + + show_sensor_info(); + return true; +} + +void sensor_plugin_loader::show_sensor_info(void) +{ + INFO("========== Loaded sensor information ==========\n"); + + int index = 0; + + auto it = m_sensors.begin(); + + while (it != m_sensors.end()) { + shared_ptr sensor = it->second; + + sensor_info info; + sensor->get_sensor_info(it->first, info); + INFO("No:%d [%s]\n", ++index, sensor->get_name()); + info.show(); + it++; + } + + INFO("===============================================\n"); +} + +bool sensor_plugin_loader::get_paths_from_dir(const string &dir_path, vector &hal_paths) +{ + DIR *dir = NULL; + struct dirent *dir_entry = NULL; + + dir = opendir(dir_path.c_str()); + + if (!dir) { + ERR("Failed to open dir: %s", dir_path.c_str()); + return false; + } + + string name; + + while ((dir_entry = readdir(dir))) { + name = string(dir_entry->d_name); + hal_paths.push_back(dir_path + "/" + name); + } + + closedir(dir); + return true; +} + +sensor_hal* sensor_plugin_loader::get_sensor_hal(sensor_hal_type_t type) +{ + auto it_plugins = m_sensor_hals.find(type); + + if (it_plugins == m_sensor_hals.end()) + return NULL; + + return it_plugins->second.get(); +} + +vector sensor_plugin_loader::get_sensor_hals(sensor_hal_type_t type) +{ + vector sensor_hal_list; + pair ret; + ret = m_sensor_hals.equal_range(type); + + for (auto it = ret.first; it != ret.second; ++it) + sensor_hal_list.push_back(it->second.get()); + + return sensor_hal_list; +} + +sensor_base* sensor_plugin_loader::get_sensor(sensor_type_t type) +{ + auto it_plugins = m_sensors.find(type); + + if (it_plugins == m_sensors.end()) + return NULL; + + return it_plugins->second.get(); +} + +vector sensor_plugin_loader::get_sensors(sensor_type_t type) +{ + vector sensor_list; + pair ret; + + if (type == ALL_SENSOR) + ret = std::make_pair(m_sensors.begin(), m_sensors.end()); + else + ret = m_sensors.equal_range(type); + + for (auto it = ret.first; it != ret.second; ++it) + sensor_list.push_back(it->second.get()); + + return sensor_list; +} + + +sensor_base* sensor_plugin_loader::get_sensor(sensor_id_t id) +{ + vector sensors; + + sensor_type_t type = (sensor_type_t) (id & SENSOR_TYPE_MASK); + unsigned int index = id >> SENSOR_INDEX_SHIFT; + + sensors = get_sensors(type); + + if (sensors.size() <= index) + return NULL; + + return sensors[index]; +} + + +vector sensor_plugin_loader::get_virtual_sensors(void) +{ + vector virtual_list; + sensor_base* module; + + for (auto sensor_it = m_sensors.begin(); sensor_it != m_sensors.end(); ++sensor_it) { + module = sensor_it->second.get(); + + if (module && module->is_virtual() == true) { + virtual_list.push_back(module); + } + } + + return virtual_list; +} + diff --git a/src/server/sensor_plugin_loader.h b/src/server/sensor_plugin_loader.h index 95c3236..6b5c726 100755 --- a/src/server/sensor_plugin_loader.h +++ b/src/server/sensor_plugin_loader.h @@ -67,6 +67,8 @@ private: bool insert_module(plugin_type type, const std::string &path); void show_sensor_info(void); + bool get_paths_from_dir(const std::string &dir_path, std::vector &hal_paths); + sensor_hal_plugins m_sensor_hals; sensor_plugins m_sensors; -- 2.7.4