platform/core/system/sensord.git
7 years agosensord: rv: fix bug that the accuracy value is not changed 74/134074/1
kibak.yoon [Wed, 14 Jun 2017 11:17:15 +0000 (20:17 +0900)]
sensord: rv: fix bug that the accuracy value is not changed

Change-Id: I9a3020ae8e748e09dbb79e0e2f13cc8c3208d65d
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: send accuracy changed event to listeners 63/134063/3
kibak.yoon [Wed, 14 Jun 2017 10:13:14 +0000 (19:13 +0900)]
sensord: send accuracy changed event to listeners

Change-Id: Idfcf4217ef2694578857c032e60ad55950198452
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: remove redundant blank lines at the end of a code block 42/133642/1
kibak.yoon [Tue, 13 Jun 2017 04:05:13 +0000 (13:05 +0900)]
sensord: remove redundant blank lines at the end of a code block

Change-Id: I90276bc03a6ddd2fb73fa5eb78ab16aa386c8ad0
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add select() before read a data to check whether it is ready or not 25/132725/2
kibak.yoon [Wed, 7 Jun 2017 08:38:06 +0000 (17:38 +0900)]
sensord: add select() before read a data to check whether it is ready or not

Change-Id: Id39cffc0107771dcdec0f7d23da6b36f39af0fbe
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: fix bug to enable external sensor on rpi3 76/132076/2
kibak.yoon [Mon, 5 Jun 2017 01:57:30 +0000 (10:57 +0900)]
sensord: fix bug to enable external sensor on rpi3

Change-Id: I9013a23afefc2e8fbcbb861a6afa74b499641884
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: remove command when manager/listener/provider are disconnected 16/129816/2
kibak.yoon [Thu, 18 May 2017 06:37:34 +0000 (15:37 +0900)]
sensord: remove command when manager/listener/provider are disconnected

- if channel is disconnected(), server releases their resources automatically.
- so it is not neccessary to release resource by sending command.

Change-Id: Ifd4ed14b20429def377f10d5a6d5dd3da18efc86
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agoTemporary fix for build errors from Tizen 3.0 snapshots 88/129188/4
Mu-Woong Lee [Mon, 15 May 2017 09:45:39 +0000 (18:45 +0900)]
Temporary fix for build errors from Tizen 3.0 snapshots

This patch enables to build other packages requiring pkgconfig(sensor),
when you need to build & install the latest sensord for Tizen 3.0 devices.

Change-Id: Ib70d2236d8b1beaf8d0a7040af5540df502de547
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
7 years agosensord: rename set_interval_cb to interval_changed_cb 03/129403/1
kibak.yoon [Tue, 16 May 2017 05:16:09 +0000 (14:16 +0900)]
sensord: rename set_interval_cb to interval_changed_cb

Change-Id: I9f7dd165b8b4a2aa3f244c4f5061f1b96d0cec84
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add location privilege to location-related sensors 15/128615/4
kibak.yoon [Wed, 10 May 2017 13:20:27 +0000 (22:20 +0900)]
sensord: add location privilege to location-related sensors

Change-Id: Ib931902c518fd67e62fb7e7dc2d8cd6340d792b3
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: fix typo errors about sensor URI 92/128592/2
kibak.yoon [Wed, 10 May 2017 11:51:25 +0000 (20:51 +0900)]
sensord: fix typo errors about sensor URI

- fix url of serveral healthinfo sensors

Change-Id: I26339da8056abb8526393b9e1dfe31eeea6a8e98
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: specify the appropriate sensor type based on URI 26/128526/5
kibak.yoon [Wed, 10 May 2017 09:12:40 +0000 (18:12 +0900)]
sensord: specify the appropriate sensor type based on URI

Change-Id: I4facc8b3b31ff2f2e19d9ebdefc0bdeea8ae2f8b
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add privilege part to URI format 25/128525/3
kibak.yoon [Wed, 10 May 2017 08:55:21 +0000 (17:55 +0900)]
sensord: add privilege part to URI format

- http://<vendor>/sensor/<privilege>/<type>/<name>

Change-Id: I10601f8f95fdb693dd02d047e2228c59e81e5dcd
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: move common part to base sensor handler 24/128524/1
kibak.yoon [Wed, 10 May 2017 08:43:43 +0000 (17:43 +0900)]
sensord: move common part to base sensor handler

- all of sensor handlers has sensor information as common part.

Change-Id: I45d14a742e246725cbd97070e80dd568678f6755
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: move sensor provider testcases to unit_provider.cpp 23/128523/1
kibak.yoon [Wed, 10 May 2017 08:40:00 +0000 (17:40 +0900)]
sensord: move sensor provider testcases to unit_provider.cpp

Change-Id: Iec7bfc6daa6f8a0281be485f854a064e7fac9b69
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: remove useless privilege and macros 22/128522/1
kibak.yoon [Wed, 10 May 2017 08:24:12 +0000 (17:24 +0900)]
sensord: remove useless privilege and macros

Change-Id: I373f5645cbdf318f397e2e3e47bc0f98b46e94ad
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: seperate socket channel for command and monitor 29/128429/1
kibak.yoon [Wed, 10 May 2017 04:12:48 +0000 (13:12 +0900)]
sensord: seperate socket channel for command and monitor

- m_cmd_channel: get sensor information / check privilege
- m_mon_channel: monitor sensors dynamically added/removed

Change-Id: If746f701ddb32aefe70eafe1f934f8251954efff
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agoFix dependency issues that occur while building sensord on an old snapshot 22/128222/1
Mu-Woong Lee [Mon, 8 May 2017 06:01:32 +0000 (15:01 +0900)]
Fix dependency issues that occur while building sensord on an old snapshot

Change-Id: I328dffa4ae1c4c13f82836c68e9218d157b57f1d
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
7 years agosensord: add lazy binding event handler to event loop 34/127934/1
kibak.yoon [Tue, 2 May 2017 11:34:05 +0000 (20:34 +0900)]
sensord: add lazy binding event handler to event loop

- TBD:
  1. thread-safe issue
  2. sensor event: global main context or thread-default context

Change-Id: I1d0f4464e14dc0e6bd0bb529ffe14cf682ef69af
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: sleep 10 ms instead of 100 ms if socket is unavailable temporarily 47/127647/3
kibak.yoon [Fri, 28 Apr 2017 07:05:03 +0000 (16:05 +0900)]
sensord: sleep 10 ms instead of 100 ms if socket is unavailable temporarily

Change-Id: I4c2552d18ce45bf16ff88703577279e19376418e
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agoRevert "sensord: spec: provide libsensor.so.2 for build dependency" 44/127644/2
Mu-Woong Lee [Fri, 28 Apr 2017 07:01:31 +0000 (07:01 +0000)]
Revert "sensord: spec: provide libsensor.so.2 for build dependency"

This reverts commit 7dd43df5b7adb9e92db533ec1c03926872b12746.

Change-Id: I08ec3e11640066d926b88f34ddb1c08932dbcb8f

7 years agoRevert "Provides libsensord.so.2()(64bit) in case of aarch64" 42/127642/1
Mu-Woong Lee [Fri, 28 Apr 2017 07:00:07 +0000 (07:00 +0000)]
Revert "Provides libsensord.so.2()(64bit) in case of aarch64"

This reverts commit 7e76859be442a519139eaa4648f38270d423ba53.

Change-Id: Ica1151ce7963371a11103975b47e79e7e6eb48bc

7 years agoProvides libsensord.so.2()(64bit) in case of aarch64 46/127446/1
Mu-Woong Lee [Thu, 27 Apr 2017 09:00:20 +0000 (18:00 +0900)]
Provides libsensord.so.2()(64bit) in case of aarch64

This is a temporary walkaround for OBS build failures

Change-Id: Iaa1f611333800160921e13c7ed8a25964c8aaab3
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
7 years agosensord: spec: provide libsensor.so.2 for build dependency 34/127434/2
kibak.yoon [Thu, 27 Apr 2017 08:30:26 +0000 (17:30 +0900)]
sensord: spec: provide libsensor.so.2 for build dependency

Change-Id: Id5a50c908c3540900af34932779552c461bf9899
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: rv: fix invalid name of magnetic sensor type URI 91/127391/1
kibak.yoon [Thu, 27 Apr 2017 06:36:06 +0000 (15:36 +0900)]
sensord: rv: fix invalid name of magnetic sensor type URI

Change-Id: Ib52c3dd5bfd8f50f686f40d6e630b1f97de02b3e
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: version up 4.0.0 for Tizen 4 85/127285/4
kibak.yoon [Thu, 27 Apr 2017 03:43:37 +0000 (12:43 +0900)]
sensord: version up 4.0.0 for Tizen 4

Change-Id: Ia69940ee6f5a1268372d994ff40381aecdcb7235
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: check validation of sensor URI to create a sensor provider 32/127232/4
kibak.yoon [Wed, 26 Apr 2017 13:01:39 +0000 (22:01 +0900)]
sensord: check validation of sensor URI to create a sensor provider

- URI format : http://<vendor>/sensor/<sensor_type>/<sensor_name>
- Apps are not allowed to create a sensor of the type in sensor_type_e.

- Allowed:
  - "http://example.org/sensor/mysensor_type/mysensor"
  - "http://developer.samsung.com/sensor/mysensor_type/mysensor"
- Disallowed:
  - "http://tizen.org/sensor/accelerometer/mysensor"      (predefined type)
  - "http://tizen.org/mysensor/accelerometer/mysensor"    (syntax error)
  - "http:/tizen.org/accelerometer/mysensor"              (syntax error)
  - "http:/example.org/sensor/mysensor/mysensor/mysensor" (syntax error)

- test command
  $ sensorctl test auto provider_uri

Change-Id: I0ce36a9c2a5a7953b975917962d50cf39c863bb3
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add NULL check when callbacks is called 93/127193/4
kibak.yoon [Wed, 26 Apr 2017 10:54:08 +0000 (19:54 +0900)]
sensord: add NULL check when callbacks is called

Change-Id: Ib2937c0e7ba4656c246b29a3addb1163d4494ef5
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: change return type from bool to int for checking errors 94/127094/2
kibak.yoon [Wed, 26 Apr 2017 07:21:57 +0000 (16:21 +0900)]
sensord: change return type from bool to int for checking errors

Change-Id: I0b232061df9ed8dd0a4297713e887c7f345a7de4
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agoMerge "sensord: change unclear classes to inner class" into devel/tizen
kibak.yoon [Wed, 26 Apr 2017 07:05:10 +0000 (07:05 +0000)]
Merge "sensord: change unclear classes to inner class" into devel/tizen

7 years agosensord: change unclear classes to inner class 27/126927/2
kibak.yoon [Tue, 25 Apr 2017 09:10:59 +0000 (18:10 +0900)]
sensord: change unclear classes to inner class

- sensor_manager_handler  -> sensor_manager::channel_handler
- sensor_provider_handler -> sensor_provider::channel_handler

Change-Id: I07637cd51e8075ca7ba7271e4b8fb4a6b2c02230
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: assign a category number to enum of commands 55/126755/3
kibak.yoon [Tue, 25 Apr 2017 04:53:18 +0000 (13:53 +0900)]
sensord: assign a category number to enum of commands

manager  : 0x100
listener : 0x200
provider : 0x300
etc      : 0x1000

Change-Id: I137dd95bc523ac591775b743f9cc6e16234a78c6
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: rename URIs of sensor type and support get_sensor(uri) properly 59/126659/5
kibak.yoon [Mon, 24 Apr 2017 12:48:55 +0000 (21:48 +0900)]
sensord: rename URIs of sensor type and support get_sensor(uri) properly

- compare string before last slash

Change-Id: I2e5f6a317298b96db8d712d5545e17f89f8408e5
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: initialize class members of sensor_provider_handler 32/126632/1
kibak.yoon [Mon, 24 Apr 2017 10:27:19 +0000 (19:27 +0900)]
sensord: initialize class members of sensor_provider_handler

Change-Id: I39bd1d2f4b73cfcca23132fb65aa3f95b0872d59
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add internal API to get URI of sensor 31/126631/1
kibak.yoon [Mon, 24 Apr 2017 10:18:15 +0000 (19:18 +0900)]
sensord: add internal API to get URI of sensor

Change-Id: I95f68aa8fefe6a04f42f621de813801859b84884
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: notify that the sensor is registered or unregistered 62/126562/8
kibak.yoon [Mon, 24 Apr 2017 07:15:47 +0000 (16:15 +0900)]
sensord: notify that the sensor is registered or unregistered

Change-Id: I606dd37f3ad045db4ac0d9517b7c87469b9ac37e
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: implement application sensor handler 61/126561/6
kibak.yoon [Mon, 24 Apr 2017 07:13:00 +0000 (16:13 +0900)]
sensord: implement application sensor handler

Change-Id: If415a7268adf9d7cd5870ba62a0f4bd7497baccf
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: do not let the listener have sensor pointer directly 60/126560/4
kibak.yoon [Mon, 24 Apr 2017 06:55:55 +0000 (15:55 +0900)]
sensord: do not let the listener have sensor pointer directly

- Since the sensor could be registered or unregistered in runtime,
the sensor pointer of sensor listener can be NULL
when the sensor is unregistered.
- This patch modifies the listener has only the sensor URI and requests
  a handle to the sensor manager if needed.

Change-Id: I7967a332577eb7a0a41c7e678eea85b6b3f55dfd
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: implement URI-based and provider internal APIs 53/126553/4
kibak.yoon [Mon, 24 Apr 2017 06:53:27 +0000 (15:53 +0900)]
sensord: implement URI-based and provider internal APIs

Change-Id: Id76f26d41ce124323bc581fd8ceb6820e73f1be7
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: detect that a sensor is added or removed in runtime (client-side) 52/126552/4
kibak.yoon [Mon, 24 Apr 2017 06:48:07 +0000 (15:48 +0900)]
sensord: detect that a sensor is added or removed in runtime (client-side)

Change-Id: Ie9c4e93ca77f911226bce6b72f9517185bb43dd2
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add sensor_provider for app-level sensor 51/126551/4
kibak.yoon [Mon, 24 Apr 2017 06:45:21 +0000 (15:45 +0900)]
sensord: add sensor_provider for app-level sensor

Change-Id: Ic0e02eafabe455e711a52ae1db1e86dae707f975
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add command types/macros for sensor provider 50/126550/4
kibak.yoon [Mon, 24 Apr 2017 06:39:17 +0000 (15:39 +0900)]
sensord: add command types/macros for sensor provider

Change-Id: I6f4b5adcd116eadd0a94dd0fef69027030ac6ca6
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: remove set/get API for the URI of sensor type 46/126546/2
kibak.yoon [Mon, 24 Apr 2017 06:33:27 +0000 (15:33 +0900)]
sensord: remove set/get API for the URI of sensor type

- It doesn't necessary because it is already contained in the URI.

Change-Id: I3a360004441558a5498face4211c5512db68a1e9
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add testcase for sensor-provider APIs 33/126533/2
kibak.yoon [Mon, 24 Apr 2017 05:24:56 +0000 (14:24 +0900)]
sensord: add testcase for sensor-provider APIs

1. add "http://tizen.org/sensor/mysensor/mysensor"
2. publish events to sensor listeners
3. start/stop/set_interval callbacks
4. sensor_added_cb/sensor_removed_cb callbacks

Change-Id: I98c49388ecfcd677c2c517cfb1e1d4cf3f405f26
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add skeleton APIs for sensor provider 19/126519/4
kibak.yoon [Mon, 24 Apr 2017 03:42:53 +0000 (12:42 +0900)]
sensord: add skeleton APIs for sensor provider

Change-Id: I22659ac09301f7ba12b2de4613217b78faefdaa4
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agoRemove the fake packages libsensord and libsensord-devel 14/126514/1
Mu-Woong Lee [Mon, 24 Apr 2017 03:33:36 +0000 (12:33 +0900)]
Remove the fake packages libsensord and libsensord-devel

Change-Id: Id3dec722390a5ac44b7cb1b4951f5afac7889eb9
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
7 years agosensord: remove sleep() in new failed handler 88/126088/1
kibak.yoon [Thu, 20 Apr 2017 05:34:31 +0000 (14:34 +0900)]
sensord: remove sleep() in new failed handler

Change-Id: I74714fe67becd945d95e869f5de96241ebe3325e
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: initialize cynara conf pointer to NULL 59/126059/2
kibak.yoon [Thu, 20 Apr 2017 03:58:44 +0000 (12:58 +0900)]
sensord: initialize cynara conf pointer to NULL

Change-Id: Ie80f3ad0053001424472bb03521450cebf5a6f92
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: sleep 100ms instead of a very short time 53/126053/2
kibak.yoon [Thu, 20 Apr 2017 03:56:49 +0000 (12:56 +0900)]
sensord: sleep 100ms instead of a very short time

Change-Id: Ib6432a072cb59bf03803915c497916695993a340
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: replace usleep() code with sleep() 52/126052/1
kibak.yoon [Thu, 20 Apr 2017 03:53:51 +0000 (12:53 +0900)]
sensord: replace usleep() code with sleep()

- this patch makes it a one second delay instead of 100ms.
  It's no problem.

Change-Id: I7f291e06247716a556a0bf8fa4e4293511beec59
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: remove unnecessary usleep() 51/126051/1
kibak.yoon [Thu, 20 Apr 2017 03:52:36 +0000 (12:52 +0900)]
sensord: remove unnecessary usleep()

Change-Id: I3190710465ea1dcdef396b84155403a6418fd210
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: use readdir() instead of deprecated readdir_r 63/125263/1
kibak.yoon [Fri, 14 Apr 2017 08:58:03 +0000 (17:58 +0900)]
sensord: use readdir() instead of deprecated readdir_r

Change-Id: Iad45c3eea70923dc6f42a966b4ed0c62fcb3ebc4
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: fix bug with invalid character(!) 57/125257/1
kibak.yoon [Fri, 14 Apr 2017 08:22:54 +0000 (17:22 +0900)]
sensord: fix bug with invalid character(!)

Change-Id: Ib35b0f4c2ea3dc1d9c169ef24fa533a99d21c9c8
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: rename fusion sensors to proper name 32/125232/1
kibak.yoon [Fri, 14 Apr 2017 07:44:54 +0000 (16:44 +0900)]
sensord: rename fusion sensors to proper name

Change-Id: Ied998d22a50464a735b7f37a893c0de51c6d282f
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add defensive code for blocking issue 36/125136/1
kibak.yoon [Fri, 14 Apr 2017 03:24:47 +0000 (12:24 +0900)]
sensord: add defensive code for blocking issue

- this issue is related to hrm_raw sensor device driver

Change-Id: Ib75c56b7847b4afe8aeb3a14609168a47a669b64
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: remove unnecessary socket log 79/123679/3
kibak.yoon [Thu, 6 Apr 2017 10:55:46 +0000 (19:55 +0900)]
sensord: remove unnecessary socket log

Change-Id: I7a7213ebd917ccf88172b159667ad8b9169daa63
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: suppress verbos log message 90/125090/1
kibak.yoon [Thu, 13 Apr 2017 16:10:01 +0000 (01:10 +0900)]
sensord: suppress verbos log message

- highlight compile errors/warnings

Change-Id: I19b34adff7fd0488109c6361dea70d0865f7a1db
Signed-off-by: kibak.yoon <seseki17@gmail.com>
7 years agosensord: support get_data() API simply 89/125089/1
kibak.yoon [Thu, 13 Apr 2017 16:07:36 +0000 (01:07 +0900)]
sensord: support get_data() API simply

- [TBD] it doesn't consider whether the value is normal or not.

Change-Id: I5b5517c82d8282cf433fe6b7eb4b9a2956346d0b
Signed-off-by: kibak.yoon <seseki17@gmail.com>
7 years agosensord: separate channel for event and command 88/125088/1
kibak.yoon [Thu, 13 Apr 2017 16:00:56 +0000 (01:00 +0900)]
sensord: separate channel for event and command

- if the event occurs during sending command, a timing issue will occur.

Change-Id: I8ed5ad2f7c6bcc9ea44641c619458639553822c2
Signed-off-by: kibak.yoon <seseki17@gmail.com>
7 years agosensord: compare previous interval with current interval 87/125087/1
kibak.yoon [Thu, 13 Apr 2017 15:56:05 +0000 (00:56 +0900)]
sensord: compare previous interval with current interval

Change-Id: I65c56ce4a3757447fb1fdc61b344732fcd4dbc9b
Signed-off-by: kibak.yoon <seseki17@gmail.com>
7 years agosensord: add required privilege to pre-defined types 86/125086/1
kibak.yoon [Thu, 13 Apr 2017 15:53:52 +0000 (00:53 +0900)]
sensord: add required privilege to pre-defined types

Change-Id: I0f08ad04497fa544318b1bd57dc7a2af470fa99a
Signed-off-by: kibak.yoon <seseki17@gmail.com>
7 years agosensord: use int32_t instead size_t 85/125085/1
kibak.yoon [Thu, 13 Apr 2017 15:51:14 +0000 (00:51 +0900)]
sensord: use int32_t instead size_t

- compatibility with 64bit platform

Change-Id: I16299dfe15418492506063ce6572e7cdf9502127
Signed-off-by: kibak.yoon <seseki17@gmail.com>
7 years agosensord: return the appropriate error 84/125084/1
kibak.yoon [Thu, 13 Apr 2017 15:42:10 +0000 (00:42 +0900)]
sensord: return the appropriate error

Change-Id: I953af6979592f003b7967898f2389b782b562f63
Signed-off-by: kibak.yoon <seseki17@gmail.com>
7 years agosensord: use underscore(_) instead of dot(.) for URI string 83/125083/1
kibak.yoon [Thu, 13 Apr 2017 15:31:56 +0000 (00:31 +0900)]
sensord: use underscore(_) instead of dot(.) for URI string

- [TBD] discuss what is the better

Change-Id: I6c41cc4eca22062159734ebfae422f9da0ce7c04
Signed-off-by: kibak.yoon <seseki17@gmail.com>
7 years agosensord: use emplace_back instead of push_back 82/125082/1
kibak.yoon [Thu, 13 Apr 2017 15:30:48 +0000 (00:30 +0900)]
sensord: use emplace_back instead of push_back

Change-Id: I812a34b162a982dfa1ba7033bcb35e758d8d71dd
Signed-off-by: kibak.yoon <seseki17@gmail.com>
7 years agosensord: enable rotation vector/orientation sensors 81/125081/1
kibak.yoon [Thu, 13 Apr 2017 15:30:02 +0000 (00:30 +0900)]
sensord: enable rotation vector/orientation sensors

Change-Id: I60368ad616e34f17107565c6014135a4aeb4aacb
Signed-off-by: kibak.yoon <seseki17@gmail.com>
7 years agosensord: remove unnecessary testcases for fusion library 80/125080/1
kibak.yoon [Thu, 13 Apr 2017 15:24:49 +0000 (00:24 +0900)]
sensord: remove unnecessary testcases for fusion library

Change-Id: Iaf95f379ccf05cfa2c8f001d1976804d50ad7b10
Signed-off-by: kibak.yoon <seseki17@gmail.com>
7 years agosensord: enable linear acceleration sensor 72/125072/2
kibak.yoon [Thu, 13 Apr 2017 15:22:10 +0000 (00:22 +0900)]
sensord: enable linear acceleration sensor

Change-Id: I6cd5d9ae2606e5544f2fdde2830ee33392d5e81a
Signed-off-by: kibak.yoon <seseki17@gmail.com>
7 years agosensord: enable gravity sensors (lowpass and complementary) 70/123670/3
kibak.yoon [Wed, 12 Apr 2017 10:54:18 +0000 (19:54 +0900)]
sensord: enable gravity sensors (lowpass and complementary)

Change-Id: I7324bb6b806befc188145ed26281db9a8a65d36e
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: enable auto_rotation sensor 62/123662/5
kibak.yoon [Wed, 12 Apr 2017 09:57:17 +0000 (18:57 +0900)]
sensord: enable auto_rotation sensor

Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
Change-Id: I16b057a84c9606297a5a7d8b481bae633a95b69c

7 years agosensord: modify sensor plugin interface 71/125071/2
kibak.yoon [Wed, 12 Apr 2017 09:54:08 +0000 (18:54 +0900)]
sensord: modify sensor plugin interface

- rename from get_sensors to get_sensor_info()
- change the parameter of update() from id to URI

* [TBD] the name of sensor_notifier

Change-Id: Ie50afe75a3517847d17e259a6bf317095a827cc7
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agoRename packages in a more conventional way: sensord & sensord-dummy 34/124834/1
Mu-Woong Lee [Wed, 12 Apr 2017 12:30:47 +0000 (21:30 +0900)]
Rename packages in a more conventional way: sensord & sensord-dummy

Change-Id: I5a86ca6256fc0781cccea5e6806520c4d3b9822b
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
7 years agosensord: fix warnings detected from static analysis 89/124689/5
kibak.yoon [Wed, 12 Apr 2017 03:39:16 +0000 (12:39 +0900)]
sensord: fix warnings detected from static analysis

- fix member variable initialziation ordered warnings
- add missing breaks in switch-case statement
- check the range of index

Change-Id: Iaf75452578b69b9a7952321d25db75e53be7ca81
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: rename information list/map properly 18/124618/3
kibak.yoon [Wed, 12 Apr 2017 03:28:15 +0000 (12:28 +0900)]
sensord: rename information list/map properly

Change-Id: I1e56466e0ef00c428196cb5df1340839236c9ab5
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: support original path to load HAL library 57/124557/4
kibak.yoon [Tue, 11 Apr 2017 18:06:21 +0000 (03:06 +0900)]
sensord: support original path to load HAL library

Change-Id: Id32a8e5d2f008766542ee9a46e5757a284667630
Signed-off-by: kibak.yoon <seseki17@gmail.com>
7 years agosensord: fix to return approprivate error 13/124613/2
kibak.yoon [Wed, 12 Apr 2017 02:24:49 +0000 (11:24 +0900)]
sensord: fix to return approprivate error

Change-Id: I4d1ca524b4041232ed7c8e350f3261b264112ceb
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: check privilege everytime for every request 06/124606/4
kibak.yoon [Wed, 12 Apr 2017 02:00:27 +0000 (11:00 +0900)]
sensord: check privilege everytime for every request

- check privilege for get_sensor/get_sensor_list
- check privilege for all controls

Change-Id: I7148c7d506bb1eaa01046e60b1b81a0ce5ec899a
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add tokenize function to sensor::utils 04/124604/2
kibak.yoon [Wed, 12 Apr 2017 01:59:22 +0000 (10:59 +0900)]
sensord: add tokenize function to sensor::utils

Change-Id: I8f646d00a241f23a8ee2ca3725102fecf8ec220c
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: remove sensor_permission_t in the sensord 02/124602/1
kibak.yoon [Wed, 12 Apr 2017 01:56:31 +0000 (10:56 +0900)]
sensord: remove sensor_permission_t in the sensord

- SENSOR_PRIVILEGE_PUBLIC should be 0 because of backwards
  compatibility.

Change-Id: I81ff50e0e15459ede107925cc9eedfbabdedc9b8
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: fix a bug which did not check privilege 97/124597/1
kibak.yoon [Wed, 12 Apr 2017 01:52:13 +0000 (10:52 +0900)]
sensord: fix a bug which did not check privilege

- missing cynara check

Change-Id: I3bb6de4babadfd17f45b0b99f2b957942c05cb95
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: move member functions from public to private 92/124592/1
kibak.yoon [Wed, 12 Apr 2017 01:43:29 +0000 (10:43 +0900)]
sensord: move member functions from public to private

Change-Id: Ibbf486527e7b41663c6a3948071602d897b890b0
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensor: remove a bad way for hiding sensor handle 55/123855/2
kibak.yoon [Fri, 7 Apr 2017 08:25:51 +0000 (17:25 +0900)]
sensor: remove a bad way for hiding sensor handle

- from now on, privilege is not checking.

Change-Id: I4853b27e2bb7a7c2fc1775974d9df8e199b46ec8
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: remove sensor_permission_t from sensor_info 52/123852/2
kibak.yoon [Fri, 7 Apr 2017 08:18:00 +0000 (17:18 +0900)]
sensord: remove sensor_permission_t from sensor_info

- it just only needs privilege string.

Change-Id: I82b25ae10075167781ed21baf62fe868a7b48450
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: check URI to find the matched sensor 56/124556/1
kibak.yoon [Tue, 11 Apr 2017 15:32:56 +0000 (00:32 +0900)]
sensord: check URI to find the matched sensor

Change-Id: Ib6d0364fd7036c295129872b7db79f0bd8f40685
Signed-off-by: kibak.yoon <seseki17@gmail.com>
7 years agosensord: add testcase for internal apis 61/123661/1
kibak.yoon [Thu, 6 Apr 2017 10:16:45 +0000 (19:16 +0900)]
sensord: add testcase for internal apis

- there are just only basic testcases.
- [TBD] more test cases will be added.

Change-Id: I28e44c0001ef77ce6349e0b03bc6b17bf7dea429
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: implement server_channel_handler 57/123657/1
kibak.yoon [Thu, 6 Apr 2017 10:14:20 +0000 (19:14 +0900)]
sensord: implement server_channel_handler

- server_channel_handler is a handler that responds to client request.

Change-Id: I788010896384f686fa271d61662cd09ae48ca4c2
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add calibration node setting 56/123656/1
kibak.yoon [Thu, 6 Apr 2017 10:12:15 +0000 (19:12 +0900)]
sensord: add calibration node setting

- read calibration file path from configuration file(/etc/sensor_cal.conf)

Change-Id: Ic256a0352e1e047dc4d7a3cc091a0b7cdaf106be
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add sensor_manager to create and manage sensor_handlers 51/123651/3
kibak.yoon [Thu, 6 Apr 2017 09:55:11 +0000 (18:55 +0900)]
sensord: add sensor_manager to create and manage sensor_handlers

- add sensor_event_handler which is to listen events from physical sensor

Change-Id: I6854ee874c52c003e4e1daa37a57974ee4b434e4
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: pass observer handle to flush() 53/123653/1
kibak.yoon [Thu, 6 Apr 2017 10:04:16 +0000 (19:04 +0900)]
sensord: pass observer handle to flush()

Change-Id: I4c95531c5461324c41c1ac5eb63cfb4ed00dea99
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add sensor_listener_proxy class 50/123650/2
kibak.yoon [Thu, 6 Apr 2017 09:52:33 +0000 (18:52 +0900)]
sensord: add sensor_listener_proxy class

- sensor_listener_proxy is a proxy of client's listener
- it listens sensor event as observer and controls sensors

Change-Id: I40b398f0701e7940a9893f54b896568debb3ed36
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add application_sensor_handler skeleton class 49/123649/2
kibak.yoon [Thu, 6 Apr 2017 09:49:55 +0000 (18:49 +0900)]
sensord: add application_sensor_handler skeleton class

- application_sensor_handler will be created by application
- application_sensor_handler provides:
  - events from application to observers(listeners)

Change-Id: Ic33e1c164ddfc98766eec6e82b2b537ccf4c5a6a
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add external_sensor_handler class 48/123648/2
kibak.yoon [Thu, 6 Apr 2017 09:47:29 +0000 (18:47 +0900)]
sensord: add external_sensor_handler class

- external_sensor_handler provides:
  - controls for operating external_sensor
  - controls for operation policy
  - listening event from notifier and notify it to observers

Change-Id: I3213c7798873833b8bb5e0307275fd2a3bd52bf6
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add fusion_sensor_handler class 47/123647/2
kibak.yoon [Thu, 6 Apr 2017 09:45:57 +0000 (18:45 +0900)]
sensord: add fusion_sensor_handler class

- fusion_sensor_handler provides:
  - sensor information
  - controls for operating required sensors
  - controls for operation policy

Change-Id: Id1f6d7d6dce67611a00c5f9e2880f4d2178cb145
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add physical_sensor_handler class 46/123646/1
kibak.yoon [Thu, 6 Apr 2017 09:43:32 +0000 (18:43 +0900)]
sensord: add physical_sensor_handler class

- physical_sensor_handler provides:
  - controls for operating sensor HAL(sensor_device)
  - controls for operation policy

Change-Id: I4c5d6b2d99847485ffd8beec1a9634b20ce45e71
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add loader to load sensor plugins 28/123628/2
kibak.yoon [Thu, 6 Apr 2017 08:54:20 +0000 (17:54 +0900)]
sensord: add loader to load sensor plugins

- it loads sensor_device/physical_sensor/fusion_sensor/external_sensor

Change-Id: Ia340e4041900d9a69a0553acc34473cf218a0f95
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add physical_sensor/fusion_sensor/external_sensor interfaces 01/123601/4
kibak.yoon [Thu, 6 Apr 2017 07:58:05 +0000 (16:58 +0900)]
sensord: add physical_sensor/fusion_sensor/external_sensor interfaces

- add sensor information structure(sensor_info2_t)..

Change-Id: I9daca248bc3671b77c3f37c8547575a9ab2903f5
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: implement sensor_handler class 98/123598/1
kibak.yoon [Thu, 6 Apr 2017 07:45:06 +0000 (16:45 +0900)]
sensord: implement sensor_handler class

- sensor_handler has:
  - a common logic of publisher
  - sensor control interface

Change-Id: Ifbc32db62b96996d01041f6b7855b07ae07115b0
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add sensor_publisher and sensor_observer interfaces 17/123417/2
kibak.yoon [Wed, 5 Apr 2017 10:54:34 +0000 (19:54 +0900)]
sensord: add sensor_publisher and sensor_observer interfaces

- observer pattern

Change-Id: I7c0f859a48faca21f1cf51fede816cc84c9b016e
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add the basic implementation of the server-side 83/123383/1
kibak.yoon [Wed, 5 Apr 2017 09:26:20 +0000 (18:26 +0900)]
sensord: add the basic implementation of the server-side

- server provides:
  - controls for the event_loop which manages all I/O events.
- server has:
  - event_loop
  - sensor_manager
  - server_channel_handler

* it is singleton class.

Change-Id: I6d7266f3ec68a4f576428bf4d7c2e91b699a4064
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add handlers to main for new failures 82/123382/1
kibak.yoon [Wed, 5 Apr 2017 08:04:32 +0000 (17:04 +0900)]
sensord: add handlers to main for new failures

- if new(memory allocation) is failed, on_new_failed will be called.
- this patch refers to https://review.tizen.org/gerrit/#/c/123204/

Change-Id: I1817e376fb256992266a78d078cdc15ad00b6a58
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add permission_checker for checking privileges 81/123381/1
kibak.yoon [Wed, 5 Apr 2017 07:20:26 +0000 (16:20 +0900)]
sensord: add permission_checker for checking privileges

- permission_checker provides two way to check privilege:
  - by string
  - by sensor_permission_t(enum)

- [TBD] in the future, we will only check privilege with string.
- [TBD] since there is a direct dependency on cynara,
        it will be separated.

Change-Id: Ic7ddac594bebb669a9643992ef7f52f1c36dcdfb
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>