platform/core/api/peripheral-io.git
6 years ago[2/3] adc: define the adc interfaces 70/168370/1
Segwon [Thu, 11 Jan 2018 06:30:07 +0000 (15:30 +0900)]
[2/3] adc: define the adc interfaces

Change-Id: Ia8555cf0e0d6b017d05e6937cbfd94c8ceb957ee
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years ago[1/3] adc: define the adc handle struct 69/168369/1
Segwon [Thu, 11 Jan 2018 06:35:12 +0000 (15:35 +0900)]
[1/3] adc: define the adc handle struct

Change-Id: I6bd74ddb6692d0129d9882248856edcba4fdfce2
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agoMerge branch 'tizen' into tizen_4.0 64/165664/1 accepted/tizen/4.0/unified/20180103.151732 submit/tizen_4.0/20180103.062259 tizen_4.0.IoT.p2_release
Segwon [Wed, 3 Jan 2018 06:17:08 +0000 (15:17 +0900)]
Merge branch 'tizen' into tizen_4.0

* tizen:
  gpio: fix to free a handle when peripheral_gdbus_gpio_close() is failed
  gpio: enhance the interrupted callback thread safty
  gpio: do not join if the thread is null
  pio: free the memory allocated by system_info_get_platform_string()
  pio: return error when open is failed

Change-Id: Ia7a7f5960da371e0e41c06db89d1b7cf7264f127
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agogpio: fix to free a handle when peripheral_gdbus_gpio_close() is failed 43/165643/1 accepted/tizen/unified/20180103.151843 submit/tizen/20180103.062104
Segwon [Wed, 3 Jan 2018 04:22:51 +0000 (13:22 +0900)]
gpio: fix to free a handle when peripheral_gdbus_gpio_close() is failed

Change-Id: Ibab4d38a57e91b11f2c5a6e1b21e94d2c6e40eed
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agogpio: enhance the interrupted callback thread safty 41/165641/1
Segwon [Wed, 3 Jan 2018 03:10:20 +0000 (12:10 +0900)]
gpio: enhance the interrupted callback thread safty

Change-Id: Ib9374b0a62bdf7d8d71604365637d0dfacab69b6
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agogpio: do not join if the thread is null 36/165636/2
Segwon [Wed, 3 Jan 2018 03:00:19 +0000 (12:00 +0900)]
gpio: do not join if the thread is null

Change-Id: Ib1dafd777acaa7da520ac7aae050a05b1d607dca
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agopio: free the memory allocated by system_info_get_platform_string() 96/165596/2
kibak.yoon [Tue, 2 Jan 2018 09:17:53 +0000 (18:17 +0900)]
pio: free the memory allocated by system_info_get_platform_string()

Change-Id: Ibccb1798db42ac207ecb5f9d95858919b40371c6
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
6 years agopio: return error when open is failed 95/165595/1
kibak.yoon [Tue, 2 Jan 2018 08:16:54 +0000 (17:16 +0900)]
pio: return error when open is failed

- to prevent explicite null dereferenced, error should be returned when
  open is failed.

Change-Id: I645dec3879d54d43edec1ba52ace84af6c86b180
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
6 years agoMerge branch 'tizen' into tizen_4.0 12/164712/2 accepted/tizen/4.0/unified/20171221.071003 submit/tizen_4.0/20171220.125806 submit/tizen_4.0/20171221.025151
Segwon [Wed, 20 Dec 2017 12:21:06 +0000 (21:21 +0900)]
Merge branch 'tizen' into tizen_4.0

* tizen: (50 commits)
  interface: add return type EINVAL in CHECK_ERROR
  spi: exclude the positive value in the ioctl error check, becasue of the ioctl return length
  gpio: add interrupted callback
  gpio: enhance exception handling in interface function
  gpio: set initially edge_mode and direction in handle
  gdbus: communicate via gdbus when close
  test: fix to wrong number of i2c bus
  uart: flush the uart buffer when setting the flow control
  i2c: try to call ioctl() to test i2c-stub when read()/write() is failed
  [6/6] fd passing: replace to interface functions
  gpio: unuse pin in gpio handle
  error: return a recongnizable error value
  interface: remove unused constants defined from #define
  interface: fix the CHECK_ERROR macro to receive various conditions
  interface: do not use the 'strlen' and 'strncmp'
  packaging: expose only peripheral_io.h(API) at devel rpm
  coding style: cannot put parameter in function defined to have no parameter.
  interface: do not close request to daemon by gdbus.
  interface: remove +1 length when writing a char array
  spi: fix a build error due to missed before patch
  ...

Change-Id: I9162dcc957b216611a52a0c91980c38ca7bf8319
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agointerface: add return type EINVAL in CHECK_ERROR 52/164452/4 accepted/tizen/unified/20171221.071344 submit/tizen/20171220.125854 submit/tizen/20171221.025332
Segwon [Tue, 19 Dec 2017 06:38:30 +0000 (15:38 +0900)]
interface: add return type EINVAL in CHECK_ERROR

Change-Id: I7dfb65fb371c428a7ef2f030cb5711bfb9d221af
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agospi: exclude the positive value in the ioctl error check, becasue of the ioctl return... 51/164451/1
Segwon [Tue, 19 Dec 2017 06:31:25 +0000 (15:31 +0900)]
spi: exclude the positive value in the ioctl error check, becasue of the ioctl return length

Change-Id: If7d4d517c519f6d41c6bde7a7716edda4cd6a25a
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agogpio: add interrupted callback 92/164192/5
Segwon [Mon, 18 Dec 2017 02:42:48 +0000 (11:42 +0900)]
gpio: add interrupted callback

Change-Id: I6d8d2b3e6382e3ecc2ebbc7cee8747fc2290fae9
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agogpio: enhance exception handling in interface function 94/163994/4
Segwon [Thu, 14 Dec 2017 11:13:04 +0000 (20:13 +0900)]
gpio: enhance exception handling in interface function

 - GPIO set type functions require prerequisites

 1) [edge_mode]                [direction]

    none ----------------------> in, out (O)

    rising, falling, both -----> in (O)
                           \
                            ---> out (X)

 2) [direction]                [edge_mode]

    in ------------------------> none, rising, falling, both (O)

    out -----------------------> none (O)
              \
               ----------------> rising, falling, both (X)

 3) [direction]                [value]

    in ------------------------> read (O)
              \
               ----------------> write (X)

    out -----------------------> read, write (O)

Change-Id: I72f8557568916b01c1e2e9edef79ed79f5bb20e6
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agogpio: set initially edge_mode and direction in handle 85/163985/6
Segwon [Thu, 14 Dec 2017 11:05:12 +0000 (20:05 +0900)]
gpio: set initially edge_mode and direction in handle

Change-Id: Ie9c50a3d680562c9f573ee006b816a3960096c46
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agogdbus: communicate via gdbus when close 40/163240/3
Segwon [Fri, 8 Dec 2017 05:57:20 +0000 (14:57 +0900)]
gdbus: communicate via gdbus when close

Change-Id: Ieae106a611e8409c50996b68c08fcdbd3506d70b
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agotest: fix to wrong number of i2c bus 41/162541/2
Segwon [Mon, 4 Dec 2017 06:56:09 +0000 (15:56 +0900)]
test: fix to wrong number of i2c bus

Change-Id: Ifcd09204d585070d303eff86e73738772fbf2ab2
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agouart: flush the uart buffer when setting the flow control 31/160531/2
Segwon [Thu, 16 Nov 2017 14:35:59 +0000 (23:35 +0900)]
uart: flush the uart buffer when setting the flow control

Change-Id: Ie1c2609a243242ded2ecc1e4411ca07231a784b9
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agoi2c: try to call ioctl() to test i2c-stub when read()/write() is failed 26/160526/1
Segwon [Thu, 16 Nov 2017 14:20:55 +0000 (23:20 +0900)]
i2c: try to call ioctl() to test i2c-stub when read()/write() is failed

Change-Id: I71688ff99689de8b73d74166f0b8ef9cf1ebde67
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years ago[6/6] fd passing: replace to interface functions 23/160523/4
Segwon [Thu, 16 Nov 2017 12:23:40 +0000 (21:23 +0900)]
[6/6] fd passing: replace to interface functions

 - since return value of close interface function is meaningless, return type is modified to void.

Change-Id: I3ef4298ac5a47db29697bdbbca97ecfbc0e20a57
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agogpio: unuse pin in gpio handle 09/160509/1
Segwon [Thu, 16 Nov 2017 11:24:21 +0000 (20:24 +0900)]
gpio: unuse pin in gpio handle

Change-Id: I13df7070d2647a36752d46966bdb2fc71a2facfe
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agoerror: return a recongnizable error value 89/160489/1
Segwon [Thu, 16 Nov 2017 09:09:07 +0000 (18:09 +0900)]
error: return a recongnizable error value

 - unclear PERIPHERAL_ERROR_UNKNOWN error is returning too much
 - change linux error type usage to error value defined by peripheral_io

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: I3196ed16afafa3a83ba5362287d7281dcd255192

6 years agointerface: remove unused constants defined from #define 49/160449/1
Segwon [Thu, 16 Nov 2017 07:46:26 +0000 (16:46 +0900)]
interface: remove unused constants defined from #define

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: Ie8f111ae53ea28e2c013e9e96a829d4d249a87ad

6 years agointerface: fix the CHECK_ERROR macro to receive various conditions 45/160445/1
Segwon [Thu, 16 Nov 2017 07:15:19 +0000 (16:15 +0900)]
interface: fix the CHECK_ERROR macro to receive various conditions

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: Iac30913f44ba239365a37e0dd9050623ea3f8d91

6 years agointerface: do not use the 'strlen' and 'strncmp' 27/160427/2
Segwon [Thu, 16 Nov 2017 06:09:39 +0000 (15:09 +0900)]
interface: do not use the 'strlen' and 'strncmp'

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: I5113aff8d544f2e5411dbb3d158313c5e4dece2f

6 years agopackaging: expose only peripheral_io.h(API) at devel rpm 09/160409/2
Segwon [Thu, 16 Nov 2017 05:25:24 +0000 (14:25 +0900)]
packaging: expose only peripheral_io.h(API) at devel rpm

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: I39f1e6a90bd774a73a2508a43b8dffc8869d86a3

6 years agocoding style: cannot put parameter in function defined to have no parameter. 08/160408/1
Segwon [Thu, 16 Nov 2017 05:19:19 +0000 (14:19 +0900)]
coding style: cannot put parameter in function defined to have no parameter.

 - function() -> function(void)

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: I896916b02f45bdb84ed8120b3fb7273677ace9e1

6 years agointerface: do not close request to daemon by gdbus. 02/160402/1
Segwon [Thu, 16 Nov 2017 05:03:25 +0000 (14:03 +0900)]
interface: do not close request to daemon by gdbus.

 - daemon will be detect gdbus disconnection by g_bus_watch_name()

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: Id9882a8b576b9110eb21aa66a94b3fa7e9c4b14c

6 years agointerface: remove +1 length when writing a char array 95/160395/1
Segwon [Thu, 16 Nov 2017 04:15:27 +0000 (13:15 +0900)]
interface: remove +1 length when writing a char array

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: I7bbbe2f8698ee1fb90268af6f6ca8c0eaf8edb38

6 years agospi: fix a build error due to missed before patch 92/160392/1
Segwon [Thu, 16 Nov 2017 04:10:10 +0000 (13:10 +0900)]
spi: fix a build error due to missed before patch

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: I34d0b37fab426cae2cc0210ca7a9a7b8101a5598

6 years agoi2c: replace 'i2c_smbus_ioctl()' with another functions. 81/160281/1
Segwon [Wed, 15 Nov 2017 07:55:08 +0000 (16:55 +0900)]
i2c: replace 'i2c_smbus_ioctl()' with another functions.

 - do not use 'i2c_smbus_ioctl_data' structure in caller.
 - remove : i2c_smbus_ioctl()
 - add : peripheral_interface_i2c_read_register_byte()
 - add : peripheral_interface_i2c_write_register_byte()
 - add : peripheral_interface_i2c_read_register_word()
 - add : peripheral_interface_i2c_write_register_word()

Change-Id: Ia73f3febcf1412a5101a83b2106a0d7c695a2ce4
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agointerface: do not check if fd is negative 74/160274/1
Segwon [Wed, 15 Nov 2017 07:40:18 +0000 (16:40 +0900)]
interface: do not check if fd is negative

 - it is checked by the caller.
 - the check is meaningless even if handle is not opened.

Change-Id: Id22083b04f4e95a0788a32f1cbc2929c08dd8c31
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agolog: change file name "peripheral_common.h" to "peripheral_log.h" 67/160267/2
Segwon [Wed, 15 Nov 2017 07:24:33 +0000 (16:24 +0900)]
log: change file name "peripheral_common.h" to "peripheral_log.h"

Change-Id: I96c150951c7cb2c5517b305e00909b0bca5cacff
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agoincluding: remove unnecessary header files 58/160258/2
Segwon [Wed, 15 Nov 2017 06:52:34 +0000 (15:52 +0900)]
including: remove unnecessary header files

Change-Id: Ice8e09e5654bbc2e94d5c41b5e1d5d86e5b78239
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agohandle: change file name 'peripheral_internal.h' to 'peripheral_handle.h' 42/160242/2
Segwon [Wed, 15 Nov 2017 02:59:38 +0000 (11:59 +0900)]
handle: change file name 'peripheral_internal.h' to 'peripheral_handle.h'

 - the word 'internal' does not mean defining a handle structure.

Change-Id: Ica3650be46eb2285aaa543b1aadd3ae0a0f822cf
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agoincluding : move the '#include' duplicate written to common file 32/160232/2
Segwon [Wed, 15 Nov 2017 02:03:38 +0000 (11:03 +0900)]
including : move the '#include' duplicate written to common file

Change-Id: I5926833c5cef4f5d82bcca78164289562b53c2ca
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agogdbus: change 'peripheral_gdbus.h' file name to 'peripheral_gdbus_common.h' 21/160221/2
Segwon [Wed, 15 Nov 2017 01:57:02 +0000 (10:57 +0900)]
gdbus: change 'peripheral_gdbus.h' file name to 'peripheral_gdbus_common.h'

 - for match with interface

Change-Id: Ib6f2ee970976462c4b52d9a028a8ac956d17b80a
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agogdbus: add check error in gdbus functions 45/160145/4
Segwon [Tue, 14 Nov 2017 13:27:05 +0000 (22:27 +0900)]
gdbus: add check error in gdbus functions

 when gdbus request to daemon for open/close, it can receive return value TRUE with ret that it is not PERIPEHRAL_ERROR_NONE.
 In the case of requesting open to daemon, getting fd from list is meaningless.
 In the case of requesting close to daemon, proxy deinit function must not be run.

Change-Id: I6ca7b1c98a15ca17159123903cd9d8ebe57c353c
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agogdbus: refactor gdbus proxy functions 34/160134/5
Segwon [Tue, 14 Nov 2017 13:13:29 +0000 (22:13 +0900)]
gdbus: refactor gdbus proxy functions

 - changed to static
 - proxy init function has been modified to return error.

Change-Id: I220d66e31d19c4cd7e27caa18f2c5cd2cba19b00
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years ago[5/6] fd passing: remove unnecessary gdbus functions. 10/160110/2
Segwon [Tue, 14 Nov 2017 11:22:09 +0000 (20:22 +0900)]
[5/6] fd passing: remove unnecessary gdbus functions.

Change-Id: Ic2c0ae84608851344191606101dcef82df3786de
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years ago[4/6] fd passing: get file descriptor list from daemon through gdbus 99/160099/2
Segwon [Tue, 14 Nov 2017 10:58:32 +0000 (19:58 +0900)]
[4/6] fd passing: get file descriptor list from daemon through gdbus

 - save the received fds to handle.
 - it only receive fds when the open function is run.

Change-Id: Iaa3c87adaab0254c519b2f695068ae79850e3a23
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agogdbus: move gdbus files to top level gdbus folder 56/160056/1
Segwon [Tue, 14 Nov 2017 08:54:05 +0000 (17:54 +0900)]
gdbus: move gdbus files to top level gdbus folder

Change-Id: If08e00e576cb8bdb099a740768870a6bdcf41d8b
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agointerface: use the CHECK_ERROR macro for error set by system call 22/160022/3
Segwon [Tue, 14 Nov 2017 06:55:58 +0000 (15:55 +0900)]
interface: use the CHECK_ERROR macro for error set by system call

 - created a peripheral_interface_common.h file and implemented error macro
 - macro name : CHECK_ERROR

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: I5d1167ab2d7aa3e5e3b22ef2192efbd68b1f17bc

6 years agoi2c: remove unused interface function that peripheral_interface_i2c_set_address() 77/159977/3
Segwon [Tue, 14 Nov 2017 04:24:37 +0000 (13:24 +0900)]
i2c: remove unused interface function that peripheral_interface_i2c_set_address()

Change-Id: I277e99134c27a411614aac9502c700ab83f04c3e
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agointerface: change the type of parameters in interface functions. 75/159975/4
Segwon [Tue, 14 Nov 2017 04:19:48 +0000 (13:19 +0900)]
interface: change the type of parameters in interface functions.

 - it matches the parameter type of the API

Change-Id: I79d7b66fb917affd4398c1609b367859bc5da3bc
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agointerface: unuse the enum types defined in the interface 71/159971/4
Segwon [Tue, 14 Nov 2017 03:55:52 +0000 (12:55 +0900)]
interface: unuse the enum types defined in the interface

 - replace with enum types provided by the API
 - remove enum list
    1) gpio_direction_e
    2) gpio_edge_e
    3) pwm_polarity_e
    4) uart_baud_rate_e
    5) uart_byte_size_e
    6) uart_parity_e
    7) uart_stop_bits_e

Change-Id: Id70350fabf29b18c7b440be8bbfdd4b99ed3b98d
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agouart: remove unused interface function that peripheral_interface_uart_set_mode(). 70/159970/1
Segwon [Tue, 14 Nov 2017 03:43:07 +0000 (12:43 +0900)]
uart: remove unused interface function that peripheral_interface_uart_set_mode().

Change-Id: I9e1c5a7326d65598e2ce326162abd9c5c0b4806e
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agointerface: add prefix 'peripheral_interface' to file and function name. 68/159968/3
Segwon [Tue, 14 Nov 2017 03:26:22 +0000 (12:26 +0900)]
interface: add prefix 'peripheral_interface' to file and function name.

Change-Id: I23b6fe4aa850e4a713aa6e419ab334681e596d39
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years ago[3/6] fd passing: use fd directly without opening it 65/159865/1
Segwon [Mon, 13 Nov 2017 09:13:45 +0000 (18:13 +0900)]
[3/6] fd passing: use fd directly without opening it

 - delete open function
 - change parameter fd to handle because handle can have multiple fd
 - remove unnecessary functions.

Change-Id: I6a326d7047e4602604d3becf61dd5b1342666edf
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years ago[2/6] fd passing: add member variable for file descriptor in handle. 11/159811/5
Segwon [Mon, 13 Nov 2017 06:17:29 +0000 (15:17 +0900)]
[2/6] fd passing: add member variable for file descriptor in handle.

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: Ic82127b5a4426872b11da5434a8feddf53f4244e

6 years agointerface: move interface header files to top level include folder. 05/159805/3
Segwon [Mon, 13 Nov 2017 05:31:31 +0000 (14:31 +0900)]
interface: move interface header files to top level include folder.

 - seperated for readability.
 - included interface files when running build.

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: I4847dc8a7cf5f81de098a730c640229dfbc8a560

6 years ago[1/6] fd passing: move interface code from daemon. 79/159779/3
Segwon [Mon, 13 Nov 2017 04:30:38 +0000 (13:30 +0900)]
[1/6] fd passing: move interface code from daemon.

   - move from "peripheral-bus/src/interface/"
   - in order to improve performance, the lib area has direct access to the kernel.
   - not yet include in the build.

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: Id3a047968f7018ef352b01aa93cb0450ecda1f4d

7 years agocmake: fixed to wrong variable name for include file. 43/159143/1
Segwon [Tue, 7 Nov 2017 07:06:19 +0000 (16:06 +0900)]
cmake: fixed to wrong variable name for include file.

Change-Id: I570a465fc2972e3ca2fb0d0039a7232874ba1aa5
Signed-off-by: Segwon <segwon.han@samsung.com>
7 years agocmake: fixed to refer to duplicate source files. 41/159141/1
Segwon [Tue, 7 Nov 2017 07:04:04 +0000 (16:04 +0900)]
cmake: fixed to refer to duplicate source files.

Change-Id: I076ee08f8af2f1ad4445cbb5fc0bc8e089c182b1
Signed-off-by: Segwon <segwon.han@samsung.com>
7 years agoutc: added the local utc module. 77/157877/2
Segwon [Thu, 26 Oct 2017 15:01:36 +0000 (00:01 +0900)]
utc: added the local utc module.

  - generated with the new 'capi-system-peripheral-io-test' rpm.

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: Ie0e310e0ee0b6a3ac1574181b4d41e34e458e3c2

7 years agodoc: changed the word 'device' to the correct meaning. 03/157703/1 accepted/tizen/4.0/unified/20171106.162927 submit/tizen_4.0/20171026.022115 submit/tizen_4.0/20171106.084903
Segwon [Wed, 25 Oct 2017 06:49:54 +0000 (15:49 +0900)]
doc: changed the word 'device' to the correct meaning.

Change-Id: I770f16fee6e36e17c285632d5b5c8e5ef4f9bde5
Signed-off-by: Segwon <segwon.han@samsung.com>
7 years agodoc: changed the word 'device' to the correct meaning. 71/157571/2 accepted/tizen/unified/20171026.074723 submit/tizen/20171026.022104
Segwon [Wed, 25 Oct 2017 06:49:54 +0000 (15:49 +0900)]
doc: changed the word 'device' to the correct meaning.

Change-Id: I770f16fee6e36e17c285632d5b5c8e5ef4f9bde5
Signed-off-by: Segwon <segwon.han@samsung.com>
7 years agopio: check if return value of system_info_get_platform_bool is SYSTEM_INFO_ERROR_NONE... 37/155837/3 accepted/tizen/unified/20171017.071211 submit/tizen/20171016.114740
kibak.yoon [Mon, 16 Oct 2017 08:59:30 +0000 (17:59 +0900)]
pio: check if return value of system_info_get_platform_bool is SYSTEM_INFO_ERROR_NONE or not

Change-Id: I6515fa369ed5201af520e5956bd0a8716a0ee168
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agopio: check if return value of system_info_get_platform_bool is SYSTEM_INFO_ERROR_NONE... 41/155841/2 accepted/tizen/4.0/unified/20171017.212142 submit/tizen_4.0/20171016.114755 tizen_4.0.m2_release
kibak.yoon [Mon, 16 Oct 2017 08:59:30 +0000 (17:59 +0900)]
pio: check if return value of system_info_get_platform_bool is SYSTEM_INFO_ERROR_NONE or not

Change-Id: I6515fa369ed5201af520e5956bd0a8716a0ee168
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agogpio: fix the bug that interrupted callback is not called 61/154561/1 accepted/tizen/4.0/unified/20171010.163325 submit/tizen_4.0/20171010.131911 tizen_4.0.IoT.p1_release
kibak.yoon [Tue, 10 Oct 2017 11:28:43 +0000 (20:28 +0900)]
gpio: fix the bug that interrupted callback is not called

- because "link" is just only the temporary iterator, it should be changed to
  interrupt_cb_in_list pointer.

Change-Id: Ifa0f39c6e963f022fefec80f4fc1f64ffc8ad805
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agogpio: fix the bug that interrupted callback is not called 59/154559/1 accepted/tizen/unified/20171010.163342 submit/tizen/20171010.131453
kibak.yoon [Tue, 10 Oct 2017 11:28:43 +0000 (20:28 +0900)]
gpio: fix the bug that interrupted callback is not called

- because "link" is just only the temporary iterator, it should be changed to
  interrupt_cb_in_list pointer.

Change-Id: Ifa0f39c6e963f022fefec80f4fc1f64ffc8ad805
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agodoc: fixed an invalid feature key name. 72/152972/1 accepted/tizen/4.0/unified/20170929.080036 submit/tizen_4.0/20170928.055437
Segwon [Wed, 27 Sep 2017 11:43:41 +0000 (20:43 +0900)]
doc: fixed an invalid feature key name.

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: Ib4873df2fd591df2c6eac4bb7cca0562222bdbe0

7 years agodoc: fixed an invalid feature key name. 71/152971/1 accepted/tizen/unified/20170928.150139 submit/tizen/20170928.055419
Segwon [Wed, 27 Sep 2017 11:43:41 +0000 (20:43 +0900)]
doc: fixed an invalid feature key name.

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: Ib4873df2fd591df2c6eac4bb7cca0562222bdbe0

7 years agoapi: add feature invalid check. 79/152879/1 submit/tizen_4.0/20170927.094733
Segwon [Wed, 27 Sep 2017 09:31:42 +0000 (18:31 +0900)]
api: add feature invalid check.

   - add dependency the system info package.
   - almost api return the PERIPHERAL_ERROR_NOT_SUPPORTED

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: I1c3cc4a8575cf18eec0d0338cca862555b02070c

7 years agoapi: add feature invalid check. 77/152877/1 submit/tizen/20170927.094753
Segwon [Wed, 27 Sep 2017 09:31:42 +0000 (18:31 +0900)]
api: add feature invalid check.

   - add dependency the system info package.
   - almost api return the PERIPHERAL_ERROR_NOT_SUPPORTED

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: I1c3cc4a8575cf18eec0d0338cca862555b02070c

7 years agoMerge branch 'tizen' into tizen_4.0 54/152354/1 accepted/tizen/4.0/unified/20170926.171633 submit/tizen_4.0/20170926.023348
kibak.yoon [Tue, 26 Sep 2017 02:05:43 +0000 (11:05 +0900)]
Merge branch 'tizen' into tizen_4.0

* tizen:
  version up 0.1.0
  api: added parameter check statement.
  naming: added static keword at static variable.
  api: sync functions name with changed apis name.
  adc: the adc interface is not supported.
  api: modified with new API set.
  test: remove console local test app.
  Fix Security Svace issue

Change-Id: I420baf5d8ea23e4b2eb2858fb96a309f29f4c076
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agoversion up 0.1.0 49/152349/1 accepted/tizen/unified/20170926.165623 submit/tizen/20170926.023501
kibak.yoon [Tue, 26 Sep 2017 01:59:53 +0000 (10:59 +0900)]
version up 0.1.0

Change-Id: I9fa1f3932c383ebe33951123a47c025b9e3ac57b
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 years agoapi: added parameter check statement. 66/151566/4
Segwon [Thu, 21 Sep 2017 07:37:46 +0000 (16:37 +0900)]
api: added parameter check statement.

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: I610bba87b751637c1443e7cd6b1ba83a25b8f246

7 years agonaming: added static keword at static variable. 61/151461/4
Segwon [Thu, 21 Sep 2017 03:21:38 +0000 (12:21 +0900)]
naming: added static keword at static variable.

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: Ia8e14e8164311f7b40bb146a185eb08d8aabafa7

7 years agoapi: sync functions name with changed apis name. 58/151458/6
Segwon [Thu, 21 Sep 2017 03:12:41 +0000 (12:12 +0900)]
api: sync functions name with changed apis name.

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: I12c8dcc1a850b182b791674d0fe4891f74d3717a

7 years agoadc: the adc interface is not supported. 07/151407/3
Segwon [Thu, 21 Sep 2017 00:51:33 +0000 (09:51 +0900)]
adc: the adc interface is not supported.

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: I47b529fecb5820fcb633d990b76ee3d01f1aa74f

7 years agoapi: modified with new API set. 93/145993/16
Segwon [Thu, 24 Aug 2017 10:39:51 +0000 (19:39 +0900)]
api: modified with new API set.

 - ADC not supported
 - Provides get list API to get necessary for open APIs
 - Remove unnecessary and uncertain APIs
 - Terminology unification
 - Add peripheral_io_doc.h for doxygen
 - Add feature key and privilege level to doxygen

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: Ie104753f270fdcc37df62e538c9ee06d254c2db2

7 years agotest: remove console local test app. 92/151392/1
Segwon [Thu, 21 Sep 2017 00:24:11 +0000 (09:24 +0900)]
test: remove console local test app.

 - It will be replace to new something.
 - The reason is many apis changed.

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: I142c413ff220aca1752a701998117d39dfedf22d

7 years agoFix Security Svace issue 86/149786/1 submit/tizen_4.0/20170915.102620
jino.cho [Tue, 12 Sep 2017 07:45:06 +0000 (16:45 +0900)]
Fix Security Svace issue

This patch fixes security issue from SVACE.
"WID:31524889 Casting 'num' [ unsigned int *] to _Bool * makes
a pointer with a different pointee size. It can lead to
out-of-bounds memory access when dereferenced."

Change-Id: If3620630eaa8607d132da751f5ce2dc485b69ce4
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoFix Security Svace issue 06/149406/2 accepted/tizen/unified/20170918.093916 submit/tizen/20170915.102550
jino.cho [Tue, 12 Sep 2017 07:45:06 +0000 (16:45 +0900)]
Fix Security Svace issue

This patch fixes security issue from SVACE.
"WID:31524889 Casting 'num' [ unsigned int *] to _Bool * makes
a pointer with a different pointee size. It can lead to
out-of-bounds memory access when dereferenced."

Change-Id: If3620630eaa8607d132da751f5ce2dc485b69ce4
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoAdd PIE option to peripheral-io-test 14/144414/1 accepted/tizen/4.0/unified/20170828.223711 accepted/tizen/unified/20170818.001002 submit/tizen/20170817.014135 submit/tizen_4.0/20170828.100002
Hyeongsik Min [Wed, 16 Aug 2017 12:49:16 +0000 (21:49 +0900)]
Add PIE option to peripheral-io-test

Change-Id: I6e0669b4b0a7751d82ffd411006a1f33a9842877
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoAdd awk as a BuildRequries 01/141501/1
Hyeongsik Min [Tue, 1 Aug 2017 01:19:38 +0000 (10:19 +0900)]
Add awk as a BuildRequries

In order to avoid possible build break, add BuildRequies for awk
explicitly.

Change-Id: I0a8ba8be024af0453f1483bb1468df0070fa657c
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoAdd MMA7455 sample dirver codes 50/139150/6
Hyeongsik Min [Mon, 17 Jul 2017 12:48:04 +0000 (21:48 +0900)]
Add MMA7455 sample dirver codes

This moves MMA7455 driver codes to sample directory after refactoring
it.

Change-Id: Idfa9b617f5081f7ea68a236b913ec1b97ff02a7a
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoUpdate package version to 0.0.5 15/138615/1 accepted/tizen/4.0/unified/20170816.012433 accepted/tizen/unified/20170717.021134 submit/tizen/20170713.044725 submit/tizen/20170714.030511 submit/tizen_4.0/20170811.094300
jino.cho [Thu, 13 Jul 2017 04:26:04 +0000 (13:26 +0900)]
Update package version to 0.0.5

Change-Id: Ic3bf9cde4c19f30ede23d2f713ed349b4f865c3b
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoAdd test code for HC-SR04 ultrasonic raging module 88/138588/1
jino.cho [Thu, 13 Jul 2017 02:03:18 +0000 (11:03 +0900)]
Add test code for HC-SR04 ultrasonic raging module

Change-Id: I132f2b25ed977181dbffd06f9570e0db4510cb81
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoAdd a struct for gpio interrupt information 89/138389/3
jino.cho [Tue, 11 Jul 2017 11:13:33 +0000 (20:13 +0900)]
Add a struct for gpio interrupt information

This patch adds gpio isr callback data deliverd via gpio_isr_cb().
A gpio isr callback data is delivered as a structure, which contains
the pin number, the pin value, and the timestamp(ms)  when the gpio
interrupt occurred.

Change-Id: Iee60dc4d33fe856d46fda83c487ed27d8d1fadae
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoImprove preset test(I2C, PWM) 49/134049/2
Hyeongsik Min [Wed, 14 Jun 2017 09:47:10 +0000 (18:47 +0900)]
Improve preset test(I2C, PWM)

- Get user input for PWM device and channel number.
- Read 2 bytes from GY30 light sensor.

Change-Id: I2225119d7ae21e8fd7ebe9bd794c04afe0f40dd1
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoAdd log messages to API function 84/133784/2
Hyeongsik Min [Tue, 13 Jun 2017 09:57:05 +0000 (18:57 +0900)]
Add log messages to API function

- Add log message for failure cases.
- Improve parameter validation with log messages.

Change-Id: I21f99c8fbbe1f50032da8933dbb92b6b21faad11
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoRemove unnecessary EOL in log message 45/133645/2 accepted/tizen/unified/20170613.194839 submit/tizen/20170613.105843
Hyeongsik Min [Tue, 13 Jun 2017 04:12:05 +0000 (13:12 +0900)]
Remove unnecessary EOL in log message

Change-Id: Ibd4a653e4ef1b77a13c0efbb866ade6249db04ff
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoAdd API for the adc device 65/133265/4
jino.cho [Thu, 1 Jun 2017 01:32:26 +0000 (10:32 +0900)]
Add API for the adc device

This patch support the adc device. And, it should work properly
if the patch for peripheral-bus is applied together.

Change-Id: Iac0b0d3421634443ef2de95268b748ab098d5170
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoReplace error code from ENODEV with ENXIO 10/132910/1
Hyeongsik Min [Thu, 8 Jun 2017 07:38:07 +0000 (16:38 +0900)]
Replace error code from ENODEV with ENXIO

Change error code ENODEV to ENXIO for the case of no such device, because
ENODEV is not defined in tizen_error.h and is also suitable for the
case.

Change-Id: I5e0f6d17bc9af720fd6d15862aaa2fd8da259ad1
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoFix type mismatch issue 82/132882/1
jino.cho [Thu, 1 Jun 2017 07:18:28 +0000 (16:18 +0900)]
Fix type mismatch issue

The type size of bool and gboolean are different.
Therefore, the pointer parameter should not be used directly as
a argument of gdbus functions.

Change-Id: I6ccccab228ca5fa57bee6db02e49bbe44a15eaef
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoUpdate package version to 0.0.4 26/132126/1 accepted/tizen/unified/20170602.054034 submit/tizen/20170602.034029
Hyeongsik Min [Thu, 1 Jun 2017 06:59:17 +0000 (15:59 +0900)]
Update package version to 0.0.4

Change-Id: Id21d404d52630822966c60442266c5d7337f77a8
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoImprove I2C test by using new APIs 78/132078/3
Hyeongsik Min [Thu, 1 Jun 2017 04:05:45 +0000 (13:05 +0900)]
Improve I2C test by using new APIs

Change-Id: I06302e2c4c633a1746d58384554c7ba0e59e90b0
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoAdd new APIs for I2C smbus transaction 64/132064/3
Hyeongsik Min [Thu, 1 Jun 2017 02:32:33 +0000 (11:32 +0900)]
Add new APIs for I2C smbus transaction

This patch adds below I2C APIs.
- peripheral_i2c_read_register_byte()
- peripheral_i2c_write_register_byte()
- peripheral_i2c_read_register_word()
- peripheral_i2c_write_register_word()

igned-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>

Change-Id: Ic0e96b4225b6596556b670487c905e6c77c4039c

7 years agoAdd APIs and functions for the spi device 06/131106/10
jino.cho [Thu, 25 May 2017 10:50:58 +0000 (19:50 +0900)]
Add APIs and functions for the spi device

This patch support the spi device. And, it should work properly
if the patch for peripheral-bus is applied together.

Change-Id: Ia0094e516d5dff9fba1e2d40170dc7cce844d347
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoImprove MMA7455 Accelerometer test(I2C) 94/131694/4
Hyeongsik Min [Tue, 30 May 2017 11:05:13 +0000 (20:05 +0900)]
Improve MMA7455 Accelerometer test(I2C)

If it receives gpio pin number for interrupt, the test will register isr
function to react to sensor interrupt.

Change-Id: I192db1ca642890672f5b216dbddb80cbb98f65d5
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoFix leak issue after reading byte array 75/131675/2
Hyeongsik Min [Tue, 30 May 2017 10:13:16 +0000 (19:13 +0900)]
Fix leak issue after reading byte array

Calling g_variant_unref() was missing in the routine.

Change-Id: Ie7cdfe86cab92c727397ddf31a062d8707cc65db
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoAdd i2c_write_byte, i2c_read_byte API 47/131547/4
Hyeongsik Min [Tue, 30 May 2017 02:25:18 +0000 (11:25 +0900)]
Add i2c_write_byte, i2c_read_byte API

In order to provide for single byte communication, this patch adds
peripheral_i2c_write_byte() and peripheral_i2c_read_byte() APIs.

Change-Id: I0b1404fc1571f6d21ab7bfa5ceb9a76cb8a3e936
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoAdd sub menu for preset test 92/131492/1
Hyeongsik Min [Mon, 29 May 2017 10:27:55 +0000 (19:27 +0900)]
Add sub menu for preset test

Change-Id: I5dd21166781377d15df3535be6fb2212f886203c
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoAdd preset test for MMA7455 accel. sensor 33/131133/2
Hyeongsik Min [Thu, 25 May 2017 11:51:33 +0000 (20:51 +0900)]
Add preset test for MMA7455 accel. sensor

Change-Id: I51ed963015963f48d8b78db80a4ff6c4ac0bfc6f
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoAdd description for pwm APIs 18/129918/2
jino.cho [Thu, 18 May 2017 10:25:15 +0000 (19:25 +0900)]
Add description for pwm APIs

This patch Adds description for pwm APIs.

Change-Id: I1dc40bf40e4405616c5f719d905680bf31d783e0
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoChange argument of gpio gdbus method 09/131109/1
Sungguk Na [Thu, 25 May 2017 10:34:13 +0000 (19:34 +0900)]
Change argument of gpio gdbus method

- The gpio methods will pass handle instead of device informations.
- Some arguments of gpio handle are removed.

Change-Id: I6a0910cbd5e03878c17e5c6426850dbd2865ada4
Signed-off-by: Sungguk Na <sungguk.na@samsung.com>
7 years agoAdd GPIO unit test 71/130871/7
Hyeongsik Min [Wed, 24 May 2017 07:31:03 +0000 (16:31 +0900)]
Add GPIO unit test

This patch also implements menu for each tc module and utilizes glib
IO channel to receive user input.

Change-Id: Iedce7feab1887c822b172c30aba58b0f0eab959c
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoAdditional fix to handle reference count of proxy 19/131019/2
Sungguk Na [Thu, 25 May 2017 05:14:22 +0000 (14:14 +0900)]
Additional fix to handle reference count of proxy

Proxy object should be NULL after proxy deinit,
but g_object_unref just make free the object and do not make it NULL

Change-Id: I5ca2c14606527f5610181d6470d099fcf681c8cd
Signed-off-by: Sungguk Na <sungguk.na@samsung.com>
7 years agoFix reference counting bug 86/130486/1
Hyeongsik Min [Mon, 22 May 2017 11:10:43 +0000 (20:10 +0900)]
Fix reference counting bug

Change-Id: If8be15c2815a11cc63d477e0af7fa79729a62966
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>