platform/core/system/sensord.git
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>
7 years agosensord: move dbus_listener from client to server 80/123380/1
kibak.yoon [Wed, 5 Apr 2017 07:15:30 +0000 (16:15 +0900)]
sensord: move dbus_listener from client to server

- dbus_listener is a helper class for listening dbus signal.
- it will listen AXIS_ORIENTATED policy from other framework.

Change-Id: I1705d87ebd0ab0a231f7bfccba28ba217ead9b70
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: implement sensor_listener class for clients 87/123287/2
kibak.yoon [Wed, 5 Apr 2017 06:33:47 +0000 (15:33 +0900)]
sensord: implement sensor_listener class for clients

- sensor_listener provides:
  - controls for sensor actions such as start and stop.
  - controls for changing sensor settings
  - listening for sensor events from server

Change-Id: I7216b282cc3429d0864b4343d65ff192951b1038
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: implement sensor_manager class for clients 61/123261/6
kibak.yoon [Wed, 5 Apr 2017 05:42:25 +0000 (14:42 +0900)]
sensord: implement sensor_manager class for clients

- sensor_manager provides:
  - store sensor information and manages all sensor handles
  - check whether the sensor is supported or not

- [TBD]listen an event that the application sensor is connected or disconnected

Change-Id: Icd38a74058170162bbfa8c7df6d1bdcc41d80e2d
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensor: api: implement internal api using classes 46/123246/5
kibak.yoon [Wed, 5 Apr 2017 04:50:49 +0000 (13:50 +0900)]
sensor: api: implement internal api using classes

- check invalid parameters.
- call proper operations/functions.

Change-Id: I61b9813a3f77cfd116a8ea72ee417f4cb7356640
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: api: add skeleton code of internal apis 24/123224/3
kibak.yoon [Wed, 5 Apr 2017 04:06:01 +0000 (13:06 +0900)]
sensord: api: add skeleton code of internal apis

- sensor_manager can stores and manages all of sensors.
- sensor_listener can listen sensor event and modify sensor configuation
  (interval, option, batch_latency, attributes and so on)

- rename client.cpp to sensor_internal.cpp

Change-Id: I15b74b777ba70d9c7b7d7a2c597fabf91f259b2c
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: clean up sensor_info class to support URI as name 18/123218/3
kibak.yoon [Wed, 5 Apr 2017 03:21:11 +0000 (12:21 +0900)]
sensord: clean up sensor_info class to support URI as name

- sensor_info class has sensor information and
  can support serialize/deserialize information between client and server.
- URI(type and name) is supported

- TODO-LIST
  - some information is redundant or requires a clear distinction

Change-Id: I3f40376f37cccbb003d865b7558b5fc55a3b141f
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add util functions to sensor:utils namepsace 90/123190/3
kibak.yoon [Wed, 5 Apr 2017 01:50:34 +0000 (10:50 +0900)]
sensord: add util functions to sensor:utils namepsace

- change sensor_type_t to uri
- get timestamp
- get client name

Change-Id: I3aabf426176306b31a61c4da987281f19664ac62
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: ipc: add unit testcases 81/123181/3
kibak.yoon [Wed, 5 Apr 2017 01:29:52 +0000 (10:29 +0900)]
sensord: ipc: add unit testcases

- test a connection between ipc_client and ipc_server
- test 2 clients
- test 100 clients
- test 1 client with 2 channels
- test 30 clients with large message
- test 3 normal client and 1 client with small recv buffer
- test 3 normal client and 1 client witch sleeps 10 seconds

Change-Id: I33b2e782872b51d42fc4a68b84bd5d6fe758964f
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: remove build warnings in ipc-utils 75/123175/1
kibak.yoon [Wed, 5 Apr 2017 01:19:13 +0000 (10:19 +0900)]
sensord: remove build warnings in ipc-utils

- warning: control reaches end of non-void function [-Wreturn-type]
- warning: ignoring return value [-Wunused-result]

Change-Id: Id172b9e32bfe45543b16dc9a0726bc1cc0c11441
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: ipc: add ipc_server class 66/123166/1
kibak.yoon [Wed, 5 Apr 2017 00:57:43 +0000 (09:57 +0900)]
sensord: ipc: add ipc_server class

- ipc_server class is a helper for server
- ipc_server class that makes it easy to bind/listen/accept a channel to use
  for server.
- it creates and bind/accepts socket/channel/channel_event_handler

Change-Id: If79e27a6babcf73126b56f65e750176a9ddd5c78
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: ipc: add ipc_client class 58/123158/2
kibak.yoon [Tue, 4 Apr 2017 12:30:31 +0000 (21:30 +0900)]
sensord: ipc: add ipc_client class

- ipc_client class is a helper for client.
- ipc_client class that makes it easy to connect a channel to use for clients.
- it creates and connects socket/channel/channel event_handler.

Change-Id: If75a4ab542d3623a785ccf8bccbd66628b9646db
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: ipc: add channel class 57/123157/2
kibak.yoon [Tue, 4 Apr 2017 12:15:45 +0000 (21:15 +0900)]
sensord: ipc: add channel class

- channel class is a nexus to a socket which is capable of I/O operations,
  such as read, write, connect, and bind.
- channel class provides:
  - the current state of the channel.
  - the configuration parameters of the channel.
  - the I/O operations that the channel supports.
- channel class can support synchronous/asynchronous send/read call.
- channel_handler:
  - is called by all I/O events(connect/disconnect/read and error)

Change-Id: I85365e7cb443e969653353a83f8110ab690c4303
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: ipc: add message class 14/123114/2
kibak.yoon [Tue, 4 Apr 2017 12:02:29 +0000 (21:02 +0900)]
sensord: ipc: add message class

- this class is a helper class for enconding/decoding the byte data.
- message object includes the message header automatically.
  - this header provides message id/type/size/error.

Change-Id: I03dc830baebf7a9bceac97013e9931f333f8f9d2
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: ipc: add event_loop class 01/123101/3
kibak.yoon [Tue, 4 Apr 2017 11:13:14 +0000 (20:13 +0900)]
sensord: ipc: add event_loop class

- event_loop class is a wrapper of g_main_loop.
- event_loop class has the role of I/O multiplexing.
- event_handler interface can be added to event_loop.

- it would be better to make event_loop interface to use the other main_loop..
  but now, it is not necessary yet.

- todo-list
  - add/remove idle handler

Change-Id: I74dd0636d43319e64fa2701f9b3c662e3f31c575
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: ipc: add socket class 81/123081/5
kibak.yoon [Tue, 4 Apr 2017 09:43:36 +0000 (18:43 +0900)]
sensord: ipc: add socket class

- socket class is a wrapper class of unix domain socket
- supported socket types : stream_socket, seqpacket_socket

- TC : $ sensorctl test auto ipc_socket
  - [PASS] sensor_ipc_socket.socket_p_0
  - [PASS] sensor_ipc_socket.socket_p_10
  - [PASS] sensor_ipc_socket.socket_p_1000

Change-Id: I2cb7fcb360d4a9a0c87c77d3e2b39c2bb0c06380
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: clean up command-related types and log-related files 67/123067/5
kibak.yoon [Tue, 4 Apr 2017 09:22:21 +0000 (18:22 +0900)]
sensord: clean up command-related types and log-related files

- remove sensor_log.cpp
- rename command_common.h to command_types.h

Change-Id: I01635838c0a11f466b183b3766ee013a19dee6b8
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: clean up cmake configurations 66/123066/1
kibak.yoon [Tue, 4 Apr 2017 09:09:50 +0000 (18:09 +0900)]
sensord: clean up cmake configurations

- fix typos
- use uppercase letters in commands
- use CMAKE_LD_LIBS macro to link dl library
- the sensord executable binary no longer contains a sensor code

Change-Id: I23dbdfea814ef2961eea63e8eec9e85e2a88f9eb
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensorctl: modify sensorctl to fix some issues 65/123065/1
kibak.yoon [Tue, 4 Apr 2017 09:02:53 +0000 (18:02 +0900)]
sensorctl: modify sensorctl to fix some issues

- prints sensor information with their types
- change is_running type from bool to std::atomic<bool>
- change sensor name from auto_rotation to rotation only
- if there are two or more sensors of the same type, you can select them

Change-Id: If277104ea324c1ae0da675a6e50ce677a8bbc6c9
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: change sensord systemd socket files and name 43/123043/3
kibak.yoon [Tue, 4 Apr 2017 08:34:07 +0000 (17:34 +0900)]
sensord: change sensord systemd socket files and name

- change socket file name from sensord_command.socket to .sensord.socket
- change socket file location from /tmp/ to /run/
- remove sensor_event.socket(useless)

Change-Id: If855c7a3f4c45778b309c8a932a6da1eb17519ca
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: remove sensor_common.h 34/123034/3
kibak.yoon [Tue, 4 Apr 2017 08:06:05 +0000 (17:06 +0900)]
sensord: remove sensor_common.h

- sensor_common.h is not really meaningful.
- move definitions from sensor_common.h to sensor_types.h.

Change-Id: I458bd6f9400ccef31063c524e9a74555f234f84d
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: refactoring: remove regacy code 21/114021/2
kibak.yoon [Thu, 9 Feb 2017 11:18:20 +0000 (20:18 +0900)]
sensord: refactoring: remove regacy code

Change-Id: I4ed2735fd80ab5c9345a03d87ce312c00502c3e2
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: refactoring sensorctl for testing modules 20/114020/2
kibak.yoon [Mon, 19 Dec 2016 13:52:37 +0000 (22:52 +0900)]
sensord: refactoring sensorctl for testing modules

- To refactoring, there was the following changes.
  * add test_bench to create testcases easily
  * clean tester/injector/info/loopback files

- testing command examples
  $ sensorctl test accelerometer /* test accelerometer sensor manually */
  $ sensorctl test auto all      /* test all testcases automatically with full-log */
  $ sensorctl test auto socket 0 /* test socket module automatically without full-log */
  $ sensorctl info all
  $ sensorctl inject

Change-Id: Ie888c81f85d282eab77a8e1227d26710a85e9c61
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agoAdd dummy libsensord package to fix build unresolvable issues 99/108199/1
Mu-Woong Lee [Tue, 3 Jan 2017 09:42:50 +0000 (18:42 +0900)]
Add dummy libsensord package to fix build unresolvable issues

Change-Id: I33c0c0c4ce4cf739587ca7363970a376e360b4bf
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
7 years agoAdd vconf & gio-2.0 to the package config 75/108175/1
Mu-Woong Lee [Tue, 3 Jan 2017 07:32:08 +0000 (16:32 +0900)]
Add vconf & gio-2.0 to the package config

This is for backward compatibility.
A package uses vconf, which is indirectly required by sensord-devel.

Change-Id: I45f04a02f72323637bb026f5449cf2afc147e30d
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
7 years agoRemove profile build dependency 38/108038/5
Mu-Woong Lee [Mon, 2 Jan 2017 11:21:17 +0000 (20:21 +0900)]
Remove profile build dependency

Instead of the four packages, sensord, libsensord, libsensord-devel, and sensor-hal-devel,
the following packages are produced:

- sensord : dummy internal API library, which completely disable all sensor listener features
- sensord-genuine : working internal API library and the sensor service daemon
- sensord-devel : internal API headers and the pc file
- sensor-hal-devel : API headers for Sensor HAL

Change-Id: Ie3529d6e5eba0554fd86b4d7f95ea9726db00aa4
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
7 years agoMerge branch 'tizen_3.0' into devel/tizen 71/107971/1
Mu-Woong Lee [Mon, 2 Jan 2017 06:47:05 +0000 (15:47 +0900)]
Merge branch 'tizen_3.0' into devel/tizen

* tizen_3.0:
  sensord: add dummy api library for tv profile
  sensord: accumulate pedometer data
  sensord: version up 2.0.9
  sensord: fix incorrect return type
  sensor: enable pedometer sensor
  sensor: fix return value from false to 0
  sensord: add pre_start() that should be executed before starting regardless of clients
  sensord: change log level from error to warning for the warning case
  sensor: change the hard coded path for supporting 64bit platform
  Set SmackProcessLabel to System
  sensord: store unknown rotation event when auto_rotation sensor starts
  Fix for build errors of packages that are using deprecated sensor api

Change-Id: I2ebe48403561de6312824deed5bc8fac18c1cef2
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
7 years agosensord: add dummy api library for tv profile 39/107939/3
kibak.yoon [Mon, 2 Jan 2017 05:39:03 +0000 (14:39 +0900)]
sensord: add dummy api library for tv profile

Change-Id: I610a6a2e43e475b20e96432d47b68aebe7785655
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: accumulate pedometer data 60/107460/1 accepted/tizen_3.0.m2_mobile accepted/tizen_3.0.m2_tv accepted/tizen_3.0.m2_wearable tizen_3.0.m2 tizen_3.0_tv accepted/tizen/3.0.m2/mobile/20170104.141653 accepted/tizen/3.0.m2/tv/20170104.142113 accepted/tizen/3.0.m2/wearable/20170104.142405 accepted/tizen/3.0/common/20161229.112747 accepted/tizen/3.0/ivi/20161229.054234 accepted/tizen/3.0/mobile/20161229.054136 accepted/tizen/3.0/tv/20161229.054158 accepted/tizen/3.0/wearable/20161229.054212 submit/tizen_3.0.m2/20170104.093751 submit/tizen_3.0/20161228.071938
kibak.yoon [Wed, 28 Dec 2016 06:38:07 +0000 (15:38 +0900)]
sensord: accumulate pedometer data

- accumulated pedometer data should be provided to client

Change-Id: Ib9a4bb5325867e1e55f1e8c9b9a32609915dbd08
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: version up 2.0.9 93/104493/1 accepted/tizen/3.0/common/20161215.163246 accepted/tizen/3.0/ivi/20161215.044727 accepted/tizen/3.0/mobile/20161215.044334 accepted/tizen/3.0/tv/20161215.044414 accepted/tizen/3.0/wearable/20161215.044714 submit/tizen_3.0/20161214.085226
kibak.yoon [Tue, 13 Dec 2016 11:04:01 +0000 (20:04 +0900)]
sensord: version up 2.0.9

Change-Id: I4d12ec6c0c12890c58407657dca42621cc128819
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: fix incorrect return type 87/104487/2
kibak.yoon [Tue, 13 Dec 2016 10:50:03 +0000 (19:50 +0900)]
sensord: fix incorrect return type

- int to size_t

Change-Id: Ia1d5b0308e2a9a546c1980d0bb1896a1e4a88204
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensor: enable pedometer sensor 47/104447/2
kibak.yoon [Tue, 13 Dec 2016 09:35:45 +0000 (18:35 +0900)]
sensor: enable pedometer sensor

- pedometer sensor needs healthinfo privilege

Change-Id: I9ac4e2079fd0a6e640c92b63ce13f3c3f1c81ed0
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensor: fix return value from false to 0 46/104446/1
kibak.yoon [Tue, 13 Dec 2016 07:47:53 +0000 (16:47 +0900)]
sensor: fix return value from false to 0

Change-Id: Icb84d1ec8f8e20b29f02dc86807a4fe535c79455
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add pre_start() that should be executed before starting regardless of clients 89/103889/6
kibak.yoon [Sat, 10 Dec 2016 05:57:24 +0000 (14:57 +0900)]
sensord: add pre_start() that should be executed before starting regardless of clients

Change-Id: I1cd8a70cdfcb5f838c94a1da7fced99835fbf872
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agoMerge branch 'devel/tizen' into tizen_3.0 54/102454/1 accepted/tizen/3.0/common/20161207.194152 accepted/tizen/3.0/ivi/20161207.010558 accepted/tizen/3.0/mobile/20161207.010452 accepted/tizen/3.0/tv/20161207.010529 accepted/tizen/3.0/wearable/20161207.010542 submit/tizen_3.0/20161205.094941
kibak.yoon [Tue, 6 Dec 2016 01:52:37 +0000 (10:52 +0900)]
Merge branch 'devel/tizen' into tizen_3.0

* devel/tizen:
  sensord: install required header files instead of all header files

Change-Id: I4c38df41e4b80ef81b9dbde6db7245f2b9e769a9
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: install required header files instead of all header files 51/102451/1
kibak.yoon [Tue, 6 Dec 2016 01:43:02 +0000 (10:43 +0900)]
sensord: install required header files instead of all header files

Change-Id: Ib826fe1e3464a560f58e5868c64fd4e2cf9a8136
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agoMerge branch 'devel/tizen' into tizen_3.0 13/101913/1
kibak.yoon [Fri, 2 Dec 2016 10:28:57 +0000 (19:28 +0900)]
Merge branch 'devel/tizen' into tizen_3.0

* devel/tizen:
  sensord: fix compiler warnings
  [BugFix] Reset Sensor Fusion Backend if it returns NaN because of inconsitent input and high error
  sensord: change file permission to remove execute permission
  sensord: add internal sensor types
  sensord: add sensorctl instead of original sensor-test
  sensord: change variable name of attribute-related functions
  sensord: add select before sending the event
  sensord: set socket_type when connection of client is accepted
  sensord: change socket type from stream to seqpacket
  sensord: add get wristup dbus interface
  sensord: add attributes and types to hal_types.h
  sensord: remove an useless event suffix name
  sensord: create file for macros
  sensord: change log level from error to warning for the warning case

Conflicts:
src/shared/csocket.cpp

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

7 years agosensord: fix compiler warnings 89/101889/1
kibak.yoon [Fri, 2 Dec 2016 09:44:25 +0000 (18:44 +0900)]
sensord: fix compiler warnings

Change-Id: I6c702882e120c470ac69d6b0d510021d49ceb15c
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years ago[BugFix] Reset Sensor Fusion Backend if it returns NaN because of inconsitent input... 72/101272/4
Akhil [Wed, 30 Nov 2016 13:16:08 +0000 (22:16 +0900)]
[BugFix] Reset Sensor Fusion Backend if it returns NaN because of inconsitent input and high error

Change-Id: I29fe84898d32f710cb914748d3111edfb2da38b7
Signed-off-by: Akhil <akhil.kedia@samsung.com>
7 years agosensord: change file permission to remove execute permission 06/99906/2
kibak.yoon [Thu, 24 Nov 2016 09:13:36 +0000 (18:13 +0900)]
sensord: change file permission to remove execute permission

Change-Id: I5cce417208269fdbae3899f643089ff1fbd990e5
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add internal sensor types 39/99939/2
kibak.yoon [Thu, 24 Nov 2016 12:07:39 +0000 (21:07 +0900)]
sensord: add internal sensor types

Change-Id: Ieacf15fdceb421dbc8e7912d137fcae52462a948
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add sensorctl instead of original sensor-test 38/99938/2
kibak.yoon [Thu, 24 Nov 2016 12:03:25 +0000 (21:03 +0900)]
sensord: add sensorctl instead of original sensor-test

- this sensorctl is an initial version for the sync,
  it will be updated to the latest version as soon as possible.

Change-Id: Ie532efaecf73fc742810c9b6ce53085ac8e75817
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: change variable name of attribute-related functions 37/99937/2
kibak.yoon [Thu, 24 Nov 2016 12:00:14 +0000 (21:00 +0900)]
sensord: change variable name of attribute-related functions

- change name from value_len to len
- change name from attribute to attr

Change-Id: I7a2513f207c34fd564100b6bdd1d4f2798845ca8
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add select before sending the event 12/99912/2
kibak.yoon [Wed, 16 Nov 2016 15:04:29 +0000 (00:04 +0900)]
sensord: add select before sending the event

because check client fd is writable or not, select() is added.

Change-Id: I3189b314ec574fa8201dc79e33b91ad2e7f82deb
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: set socket_type when connection of client is accepted 11/99911/2
minsoo kim [Mon, 7 Nov 2016 11:04:12 +0000 (20:04 +0900)]
sensord: set socket_type when connection of client is accepted

Currently, stream socket is used for command and sequence packet socket is
used for sensor event. but when server accepts any connection of client
server creates socket object with default socket type.

so client socket which is accepted by server must set proper socket type,
not default.

Change-Id: I789ff247a37a8048e9e4657997ac55a603b484e9
Signed-off-by: minsoo kim <ms203.kim@samsung.com>
7 years agosensord: change socket type from stream to seqpacket 10/99910/2
kibak.yoon [Thu, 27 Oct 2016 15:26:34 +0000 (00:26 +0900)]
sensord: change socket type from stream to seqpacket

Change-Id: I3ecc7f26e9917b29dfeaf4a9164012bf3df2c8f2
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: add get wristup dbus interface 09/99909/2
minsoo kim [Thu, 6 Oct 2016 07:09:30 +0000 (16:09 +0900)]
sensord: add get wristup dbus interface

SENSORD_BUS_NAME       : "org.tizen.system.sensord"
SENSORD_OBJECT_PATH    : "/Org/Tizen/System/SensorD"
SENSORD_INTERFACE_NAME : SENSORD_BUS_NAME
WRISTUP_ALGO_METHOD    : "wristup_algo"

Change-Id: Ic7992b874b2456da2ede823de6bb7ffeb579f1a0
Signed-off-by: minsoo kim <ms203.kim@samsung.com>
7 years agosensord: add attributes and types to hal_types.h 08/99908/2
kibak.yoon [Thu, 24 Nov 2016 09:21:34 +0000 (18:21 +0900)]
sensord: add attributes and types to hal_types.h

Change-Id: I0e9be365468a59ea948f6cdea1356fe46ae75979
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agosensord: remove an useless event suffix name 07/99907/2
hs81.go [Tue, 4 Oct 2016 01:46:41 +0000 (10:46 +0900)]
sensord: remove an useless event suffix name

Change-Id: Ia16741513429196bdbb1063e9a7dcdce62f8a41b
Signed-off-by: hs81.go <hs81.go@samsung.com>