platform/core/api/usb-host.git
3 years agoApply requirement for gcov automation 19/276119/2 accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix accepted/tizen_8.0_unified tizen_7.0 tizen_7.0_hotfix accepted/tizen/7.0/unified/20221110.062209 accepted/tizen/7.0/unified/hotfix/20221116.104858 accepted/tizen/8.0/unified/20231005.092912 accepted/tizen/unified/20220613.161543 submit/tizen/20220610.020359 tizen_7.0_m2_release tizen_8.0_m2_release
Youngjae Cho [Fri, 10 Jun 2022 00:19:24 +0000 (09:19 +0900)]
Apply requirement for gcov automation

Change-Id: Idbd699df51a0e01cf4d831f4431f5fa3457c09c8
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
3 years agoChange gcov object install path 36/270136/1 accepted/tizen/unified/20220128.144446 submit/tizen/20220127.011830
Youngjae Cho [Wed, 26 Jan 2022 05:34:10 +0000 (21:34 -0800)]
Change gcov object install path

Change-Id: I99381e047a1d28d5ae62590611eb0c7cef967f8b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoFix typo 52/258052/1 accepted/tizen/6.5/unified/20211028.094635 accepted/tizen/unified/20210510.100709 submit/tizen/20210510.041940 submit/tizen_6.5/20211028.161801 tizen_6.5.m2_release
taemin.yeom [Mon, 10 May 2021 03:50:26 +0000 (12:50 +0900)]
Fix typo

Change-Id: I12ae3bcc3c07754faa6677447b6b79a152f1a75d
Signed-off-by: taemin.yeom <taemin.yeom@samsung.com>
4 years ago[ACR-1626] Add usb.host privilege 58/255658/14 accepted/tizen/unified/20210420.090110 submit/tizen/20210419.112652
Hyotaek Shim [Mon, 22 Mar 2021 07:19:07 +0000 (16:19 +0900)]
[ACR-1626] Add usb.host privilege

Change-Id: I4eb9a45c8e34449810352e7a716ea95a593aa743
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
4 years agoMake gcov package 23/256323/1
Youngjae Cho [Thu, 1 Apr 2021 06:11:10 +0000 (15:11 +0900)]
Make gcov package

Change-Id: I09998981fddca80acb3812e129acadb00c800f41
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoAdd comment to usb_host_destroy() 82/255982/1 accepted/tizen/unified/20210331.053944 submit/tizen/20210329.052634
INSUN PYO [Fri, 26 Mar 2021 02:07:41 +0000 (11:07 +0900)]
Add comment to usb_host_destroy()

Change-Id: Ib716a048b5d15bcdd5b5507c220261b1108cf462

4 years agoRemove unnecessary HTML link for privilege 13/249813/1
lokilee73 [Thu, 17 Dec 2020 01:33:24 +0000 (10:33 +0900)]
Remove unnecessary HTML link for privilege

Change-Id: I989e7000d06d2cc9ecb37f22ad55fbd6329878ef
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
4 years agoRemove Requires pkgconfig(capi-base-common) 03/237003/3 accepted/tizen_6.0_unified_hotfix tizen_6.0_hotfix accepted/tizen/6.0/unified/20201030.122037 accepted/tizen/6.0/unified/hotfix/20201103.004335 accepted/tizen/6.0/unified/hotfix/20201103.051421 accepted/tizen/unified/20200820.133541 submit/tizen/20200819.040524 submit/tizen_6.0/20201029.205102 submit/tizen_6.0_hotfix/20201102.192502 submit/tizen_6.0_hotfix/20201103.114802 tizen_6.0.m2_release
lokilee73 [Wed, 24 Jun 2020 04:32:52 +0000 (13:32 +0900)]
Remove Requires pkgconfig(capi-base-common)

capi-base-common-devel package is unnecessarily included in image.
So, remove it.

Change-Id: I74a651dce063a1502d6a8bc2f40be9685cb346e4
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoChange "developer.tizen.org" link to "docs.tizen.org" 73/220073/1
Yunmi Ha [Fri, 13 Dec 2019 02:05:23 +0000 (11:05 +0900)]
Change "developer.tizen.org" link to "docs.tizen.org"

Change-Id: Ie5e5431dbce9d6abaa468360a1b6c3411468f9fe
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
5 years agoFix documantation typo 66/216366/1 accepted/tizen/unified/20191112.125134 submit/tizen/20191112.053022
Youngjae Cho [Thu, 24 Oct 2019 02:54:09 +0000 (11:54 +0900)]
Fix documantation typo

Change-Id: I6d2c164a31fb82bce83014b5178dcda2145868eb
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
6 years agoRemove executable flag from non-executable files 76/196276/2 accepted/tizen_5.5_unified_mobile_hotfix tizen_5.5_mobile_hotfix accepted/tizen/5.5/unified/20191031.030628 accepted/tizen/5.5/unified/mobile/hotfix/20201027.065312 accepted/tizen/unified/20181231.125004 submit/tizen/20181227.070601 submit/tizen/20181231.010834 submit/tizen/20181231.070821 submit/tizen_5.5/20191031.000002 submit/tizen_5.5_mobile_hotfix/20201026.185102 tizen_5.5.m2_release
lokilee73 [Thu, 27 Dec 2018 02:32:49 +0000 (11:32 +0900)]
Remove executable flag from non-executable files

Change-Id: I790ea7d3590621cef9fa6ff73ac10ae95b3f775f
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
6 years agoCheck validity of API arguments 37/195837/2
Paweł Szewczyk [Tue, 18 Dec 2018 17:54:32 +0000 (18:54 +0100)]
Check validity of API arguments

Added missing checks of pointers that can be dereferenced.

Change-Id: I217ddd993f540ad0342e984dcb25cf19d76e5842
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
6 years agoAdd capi-base-common build and running dependency. 44/190044/1
INSUN PYO [Wed, 26 Sep 2018 23:38:21 +0000 (08:38 +0900)]
Add capi-base-common build and running dependency.

To build an application using usb-host, you should need <tizen.h>.

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: Iae51813aab9df3f6300285e215e136a224fc8292

6 years agoSuppress unused cmake variables warning 98/188998/3 accepted/tizen/5.0/unified/20181102.014016 accepted/tizen/unified/20180928.080539 submit/tizen/20180927.030248 submit/tizen_5.0/20181101.000002
Paweł Szewczyk [Wed, 12 Sep 2018 09:36:47 +0000 (11:36 +0200)]
Suppress unused cmake variables warning

The %cmake macro in spec file adds some definitions, which are not used
by the CMakeLists. This causes warnings, which could be confusing in
search of real problems.

This commit ignores this kind of warnings, letting exist variables that
are not used at all.

Change-Id: I08a84c7ca51ce37913475adea63f93048037553b
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
6 years agoModify log message 33/188833/3
INSUN PYO [Tue, 11 Sep 2018 04:17:02 +0000 (13:17 +0900)]
Modify log message

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: Iacfc34bdd9ca9978d9ef6c83e35501cb2db4399c

6 years agoMinor fix on license 17/188917/1
Hyotaek Shim [Tue, 11 Sep 2018 23:49:39 +0000 (08:49 +0900)]
Minor fix on license

Change-Id: Icc9d738c677ce882d3844f4e0e244e112cafec23
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
6 years agoRemove build(packaging) warning. 15/188915/2
INSUN PYO [Tue, 11 Sep 2018 22:48:14 +0000 (07:48 +0900)]
Remove build(packaging) warning.

warning: File listed twice: /usr/lib/libcapi-system-usbhost.so.0.1.0

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: I3c96d9b81c0b919be8e31438f2209ea5165f624e

6 years agoMerge "Fix race condition between usb_host_destroy and fd_removed_cb" into tizen accepted/tizen/unified/20180912.061642 submit/tizen/20180911.111949
Pawe? Szewczyk [Tue, 11 Sep 2018 11:03:41 +0000 (11:03 +0000)]
Merge "Fix race condition between usb_host_destroy and fd_removed_cb" into tizen

6 years agoCheck if interface structure is valid when getting endpoint 90/188890/1
Paweł Szewczyk [Tue, 11 Sep 2018 10:02:25 +0000 (12:02 +0200)]
Check if interface structure is valid when getting endpoint

This prevents null-pointer dereference when interface structure is
allocated, but not properly initialized.

Change-Id: I9bf33eb06431346338668cee17a511174fc04a30
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
6 years agoFix race condition between usb_host_destroy and fd_removed_cb 35/188835/1
INSUN PYO [Tue, 11 Sep 2018 04:27:06 +0000 (13:27 +0900)]
Fix race condition between usb_host_destroy and fd_removed_cb

fd_removed_cb is called by libusb_exit() -> usbi_io_exit() -> usbi_remove_poolfd() -> ctx->fd_removed_cb.

fd_removed_cb uses context->gio_channels and context->channel_list_lock.
So, you should not free and destroy it before calling libusb_exit().

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: I5fdde607d19be9e4df9214489f91e3d33f41eaf6

6 years agoFix wrong spelling 05/187705/2 submit/tizen/20180828.043212 submit/tizen/20180830.111221
lokilee73 [Tue, 28 Aug 2018 04:09:35 +0000 (13:09 +0900)]
Fix wrong spelling

beed -> been
submited -> submitted
isochrnous -> isochronous

Change-Id: Ib4f83ad02b4b0f8ef63e098a135e3d58929026ec
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
6 years agoFix get_active_config output value 14/186814/1
Michal Bloch [Tue, 14 Aug 2018 13:49:14 +0000 (15:49 +0200)]
Fix get_active_config output value

Change-Id: I99217ea37d0783774b97a62cabe1fb3f43adaf79
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoAdd feature check in usb_host_transfer_set_callback 99/180499/2 accepted/tizen/unified/20180612.130833 submit/tizen/20180531.062454 submit/tizen/20180608.015225 submit/tizen/20180612.080457
lokilee73 [Wed, 30 May 2018 06:00:42 +0000 (15:00 +0900)]
Add feature check in usb_host_transfer_set_callback

Change-Id: I42e81cd2e71441122f27ec7074150790c75e36c7
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
7 years agoExclude system errors handling from lcov 82/180082/2
Paweł Szewczyk [Thu, 24 May 2018 09:44:44 +0000 (11:44 +0200)]
Exclude system errors handling from lcov

According to already existing policy, this commit excludes lines
responsible for handling errors of external (system) code from line
coverage.

Change-Id: I97a44a493e461ad188d17709ba0a366fd417fe10
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
7 years agoCall g_source_remove when removing fd form context 83/180083/4
Paweł Szewczyk [Thu, 24 May 2018 11:51:24 +0000 (13:51 +0200)]
Call g_source_remove when removing fd form context

Not removed glib source can cause trouble in mainloop and possible
leaks. This commit makes sure the source is removed when no longer
needed.

Change-Id: I346f9f17c1de75775b24063c3389d164e5aa6e47
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agosvace fix 29/175229/1 accepted/tizen/unified/20180411.065540 submit/tizen/20180409.103812
sanghyeok.oh [Mon, 9 Apr 2018 10:33:44 +0000 (19:33 +0900)]
svace fix

Change-Id: I347ac6e7865b3a70de1c301afa942b648651ad6c
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
7 years ago[5.0] api: Add asynchronous transfers 79/94379/18 accepted/tizen/unified/20180323.134337 submit/tizen/20180322.161345
Paweł Szewczyk [Fri, 7 Oct 2016 15:22:20 +0000 (17:22 +0200)]
[5.0] api: Add asynchronous transfers

Change-Id: I31b9773eee6cae0ec3cb935ef053d944cae0d619
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agoFix minor documentation issues 14/171314/2
Paweł Szewczyk [Wed, 28 Feb 2018 17:29:40 +0000 (18:29 +0100)]
Fix minor documentation issues

 - Fixed few typos
 - Moved ERROR_NONE to be the first on error list
 - Removed unreturned PERMISSION_DENIED error descriptions
 - Added missing INVALID_PARAMETER error description

Change-Id: I5ce5503ca05b797e748342d896919a18e012aaa1
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agoFix typing error 24/171524/1 accepted/tizen/unified/20180306.175334 submit/tizen/20180306.055558
lokilee73 [Mon, 5 Mar 2018 09:08:38 +0000 (18:08 +0900)]
Fix typing error

Change-Id: Idb9a2cfe20429e8c8b2f56c892dd8e58219e911e
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
7 years agoCheck if device is opened in getting active configuration 37/158837/1
Paweł Szewczyk [Fri, 3 Nov 2017 09:37:46 +0000 (10:37 +0100)]
Check if device is opened in getting active configuration

Change-Id: Ice65b6724f57d96b9af01c656a3df509a864b958
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agofix build warning 40/152040/1
Youngjae Shin [Mon, 25 Sep 2017 01:56:59 +0000 (10:56 +0900)]
fix build warning

Change-Id: Ideef5a0e11e42984da3f60bde95cb110b70a78ee

7 years agoapi: Add altsetting getter 88/135488/2 accepted/tizen/unified/20170905.184638 submit/tizen/20170905.070056
Paweł Szewczyk [Thu, 22 Jun 2017 13:44:37 +0000 (15:44 +0200)]
api: Add altsetting getter

Change-Id: I5e5da4a42e1a8640987cc9fe509fc0216a1a6768
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agoapi: Add API for unconfiguring devices 87/135487/2
Paweł Szewczyk [Mon, 19 Jun 2017 09:18:19 +0000 (11:18 +0200)]
api: Add API for unconfiguring devices

Change-Id: I52d1521cd1d4e6aee0ca81c56414f8cbd68c52be
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
7 years agoFix geting configuration from unconfigured device 86/135486/1
Paweł Szewczyk [Mon, 19 Jun 2017 11:17:33 +0000 (13:17 +0200)]
Fix geting configuration from unconfigured device

Device in unconfigured state does not have active configuration, but it
does not neccecarily means an error.

Change-Id: I90c581aed25175ff5f76140d33610a5d4b384ff6
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
8 years agoCommon : change string in usb_host_doc.h 45/130845/1
lokilee73 [Wed, 24 May 2017 07:15:14 +0000 (16:15 +0900)]
Common : change string in usb_host_doc.h

Change-Id: I3add980ffd98409c4be280f77f53e18b340b3c39
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
8 years agoFix blocking libusb event handling 85/129685/1 accepted/tizen/4.0/unified/20170816.012733 accepted/tizen/4.0/unified/20170828.223858 accepted/tizen/unified/20170605.151631 submit/tizen/20170605.090941 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170828.100002
Paweł Szewczyk [Wed, 17 May 2017 13:01:13 +0000 (15:01 +0200)]
Fix blocking libusb event handling

This patch changes libusb_handle_events to
libusb_handle_events_timeout_completed, which is non-blocking and does
not cause applications to hang.

Change-Id: Ieebfcab3ae827b158345e09c41d6c136a7ed0e18
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
8 years agoMerge "[4.0] [RFC] api: Add connected/disconnected events handling" into tizen accepted/tizen/unified/20170413.150547 submit/tizen/20170412.154456 tizen_4.0.m1_release
Karol Lewandowski [Wed, 12 Apr 2017 10:04:42 +0000 (03:04 -0700)]
Merge "[4.0] [RFC] api: Add connected/disconnected events handling" into tizen

8 years ago[4.0] [RFC] api: Add connected/disconnected events handling 72/113172/9
Paweł Szewczyk [Mon, 27 Mar 2017 10:03:40 +0000 (12:03 +0200)]
[4.0] [RFC] api: Add connected/disconnected events handling

Change-Id: If8a58e8401f6913956a5a1d88d5719a75aed2d0b
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
8 years agoURL : apply changed URL for the document 33/123533/1 accepted/tizen/unified/20170406.173256 submit/tizen/20170406.043409
lokilee73 [Thu, 6 Apr 2017 04:29:54 +0000 (13:29 +0900)]
URL : apply changed URL for the document

Change-Id: Ibdc923ae567f00044c1c7ab3ca513863ebf1d24d
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
8 years agoRestore correct coding style in usb_host.c 73/104173/5
Paweł Szewczyk [Mon, 12 Dec 2016 12:54:17 +0000 (13:54 +0100)]
Restore correct coding style in usb_host.c

This commit corrects the coding style errors introduced in
commit 0da04f8ec63350ac875247f1b97b9147ba852db7.
The space before the label colon is actually prohibited and detected
by checkpatch script.

Change-Id: I707d2e9a6e40cdc27dfd684c923a2deed59fd923
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
8 years agoMerge branch 'tizen_3.0' into tizen 14/107614/1 accepted/tizen_common accepted/tizen_ivi accepted/tizen_mobile accepted/tizen_tv accepted/tizen/common/20161229.140140 accepted/tizen/ivi/20161229.233202 accepted/tizen/mobile/20161229.233059 accepted/tizen/tv/20161229.233124 accepted/tizen/unified/20170309.031858 submit/tizen/20161229.040631 submit/tizen_unified/20170308.100405
taeyoung [Thu, 29 Dec 2016 01:54:46 +0000 (10:54 +0900)]
Merge branch 'tizen_3.0' into tizen

Signed-off-by: taeyoung <ty317.kim@samsung.com>
Change-Id: Ieb3ab4c6c8b4cfd251933507d80f9d16dc0970cb

8 years agoApply Tizen coding rule 90/103590/1 accepted/tizen_3.0.m2_mobile accepted/tizen_3.0.m2_tv tizen_3.0.m2 tizen_3.0_tv accepted/tizen/3.0.m2/mobile/20170104.122001 accepted/tizen/3.0.m2/tv/20170104.122333 accepted/tizen/3.0/common/20161212.060616 accepted/tizen/3.0/ivi/20161212.023906 accepted/tizen/3.0/mobile/20161212.023816 accepted/tizen/3.0/tv/20161212.023833 submit/tizen_3.0.m2/20170104.093749 submit/tizen_3.0/20161209.130513
pr.jung [Fri, 9 Dec 2016 01:35:51 +0000 (10:35 +0900)]
Apply Tizen coding rule

Change-Id: I548833719dc6748049be232b47b45111e02678ba
Signed-off-by: pr.jung <pr.jung@samsung.com>
8 years agofix not to change the output parameter when an error occurs 65/100965/1 accepted/tizen/3.0/common/20161201.135137 accepted/tizen/3.0/ivi/20161201.031525 accepted/tizen/3.0/mobile/20161201.031402 accepted/tizen/3.0/tv/20161201.031438 submit/tizen_3.0/20161130.101437
taeyoung [Wed, 30 Nov 2016 04:18:20 +0000 (13:18 +0900)]
fix not to change the output parameter when an error occurs

Change-Id: Ic809be983c09a80a07103b5b1c5554cc48e48aba
Signed-off-by: taeyoung <ty317.kim@samsung.com>
8 years agoFix API reference warning - several fixes 58/99858/1 accepted/tizen/3.0/common/20161129.103434 accepted/tizen/3.0/ivi/20161129.002439 accepted/tizen/3.0/mobile/20161129.002344 accepted/tizen/3.0/tv/20161129.002403 submit/tizen_3.0/20161128.140207
Kunhoon Baik [Thu, 24 Nov 2016 09:08:43 +0000 (18:08 +0900)]
Fix API reference warning - several fixes

Change-Id: I6b68af3d69c620bd6f0b8081e216a2882912f7ef

8 years agocoverage: remove system error logs from the coverage test 78/89878/1 accepted/tizen/3.0/common/20161114.105339 accepted/tizen/3.0/ivi/20161011.053453 accepted/tizen/3.0/mobile/20161015.032624 accepted/tizen/3.0/tv/20161016.004126 accepted/tizen/common/20161021.194020 accepted/tizen/ivi/20160929.001655 accepted/tizen/mobile/20160929.001515 accepted/tizen/tv/20160929.001709 submit/tizen/20160927.110043 submit/tizen_3.0_common/20161104.104000 submit/tizen_3.0_ivi/20161010.000000 submit/tizen_3.0_ivi/20161010.000010 submit/tizen_3.0_mobile/20161015.000001 submit/tizen_3.0_tv/20161015.000001 submit/tizen_common/20161021.175024
taeyoung [Tue, 27 Sep 2016 09:12:42 +0000 (18:12 +0900)]
coverage: remove system error logs from the coverage test

Change-Id: I14884b4715e110e6e1c6ad2f3d51273469ad431e
Signed-off-by: taeyoung <ty317.kim@samsung.com>
8 years agoremove TIZEN_ERROR_USB_HOST 64/87964/1 accepted/tizen/common/20160913.170306 accepted/tizen/ivi/20160913.042312 accepted/tizen/mobile/20160913.042240 accepted/tizen/tv/20160913.042255 submit/tizen/20160913.011724
taeyoung [Mon, 12 Sep 2016 10:23:40 +0000 (19:23 +0900)]
remove TIZEN_ERROR_USB_HOST

TIZEN_ERROR_USB_HOST is defined in capi-base-common.
Thus it needs to be remove from the usb-host.h

Change-Id: I008bd3f2b4c5b9e8b54d3209468406027b398a98
Signed-off-by: taeyoung <ty317.kim@samsung.com>
8 years agoremove usb_host_device_get_string_descriptor_ascii() from the api list 58/87958/1
taeyoung [Mon, 12 Sep 2016 09:10:09 +0000 (18:10 +0900)]
remove usb_host_device_get_string_descriptor_ascii() from the api list

it can be replaced to usb_host_device_get_serial_number_str(),
usb_host_device_get_product_str(), usb_host_device_get_manufacturer_str().

Change-Id: I4bf8fd54eb3138e11e72b0ff65a56ee107356700
Signed-off-by: taeyoung <ty317.kim@samsung.com>
8 years agoapi: Fix documentation and spelling 76/87176/3
Paweł Szewczyk [Tue, 6 Sep 2016 16:33:10 +0000 (18:33 +0200)]
api: Fix documentation and spelling

Change-Id: I9402bb3d6c43874b32621e84920d3a50400a0a67
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
8 years agofeature: add feature check routine 79/86879/1
taeyoung [Mon, 5 Sep 2016 10:27:11 +0000 (19:27 +0900)]
feature: add feature check routine

- "http://tizen.org/feature/usb.host" feature is required
  to use usb host apis. Thus the feature check routine is added.

Change-Id: I291bc5bfc67c8348d48edea8738c349237057a06
Signed-off-by: taeyoung <ty317.kim@samsung.com>
8 years agocommon: remove unused codes 54/86554/1 submit/tizen/20160905.095524
taeyoung [Fri, 2 Sep 2016 01:02:12 +0000 (10:02 +0900)]
common: remove unused codes

- test dir, example dir: they are not included to image.
     Thus they need to be removed
- others: Unused codes should be removed

Change-Id: I7518ec23f6e64b268a6811e758761ac23ae6baa0
Signed-off-by: taeyoung <ty317.kim@samsung.com>
8 years agoapi: Switch to Tizen Native API conventions 95/64795/42
Paweł Szewczyk [Thu, 7 Apr 2016 13:55:29 +0000 (15:55 +0200)]
api: Switch to Tizen Native API conventions

Change-Id: I41fa22da669864b161f4d6ac8baed19d9f1916dd
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
9 years agotests: Add tests of asynchronous API 17/62117/1
Paweł Szewczyk [Thu, 10 Mar 2016 11:06:37 +0000 (12:06 +0100)]
tests: Add tests of asynchronous API

Change-Id: Ia090f9817c222df4c88f5dcebc81982ff7ee7679
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
9 years agolibhusb: Add async transfer API 06/61406/4
Paweł Szewczyk [Mon, 7 Mar 2016 14:23:23 +0000 (15:23 +0100)]
libhusb: Add async transfer API

Change-Id: Ia1a09dfaa32e6f420eb64f3df22825e9f6349e6d
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
9 years agousd: Remove USD 61/61061/2 submit/tizen_common/20160317.155115
Paweł Szewczyk [Tue, 1 Mar 2016 15:30:11 +0000 (16:30 +0100)]
usd: Remove USD

USD functionality is moved to deviced. This code is no longer needed.

Change-Id: Iec6f46134df8070d7dafb89b19eff5571e872605
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
9 years agotests: add libhusb_{get,free}_config_descriptor test
Michal Bloch [Mon, 26 Oct 2015 17:45:42 +0000 (18:45 +0100)]
tests: add libhusb_{get,free}_config_descriptor test

Change-Id: I910e7d899ba69b5a284a005e2b114f3a3217fc1c
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
9 years agotests: add a better libhusb_close test
Michal Bloch [Tue, 27 Oct 2015 18:32:35 +0000 (19:32 +0100)]
tests: add a better libhusb_close test

Since libhusb_device_open_with_vid_pid creates
a device handle with the necessary properties,
i.e. containing a real libusb_device_handle, it
can be used for the libhusb_close test.

This also fixes a memory leak because the handle
was not else deallocated.

The old libhusb_close test (manual allocation
of the libusb_device_handle) stays because it
allows more flexibility as we have control over
what the libusb_device_handle contains, unlike
when using libhusb_device_open_with_vid_pid.

Change-Id: Ic2a77f458023e1e3099ff2e2623fa35730e6bebb
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
9 years agotests: fix libhusb_release_interface tests
Michal Bloch [Mon, 26 Oct 2015 16:43:49 +0000 (17:43 +0100)]
tests: fix libhusb_release_interface tests

The kernel driver attachment part of the
function was ignored, which would sometimes
lead to the test failing when the attachment
was called - this happened randomly because
the value was never initialized.

The simple test for libhusb_release_interface
is changed to make sure it does not check this
scenario. A new sub-test is added to do so.
The invalid arguments test is unaffected as it
never gets to the kernel driver attachment part.

Change-Id: I3628942b436940508ab5b93a76cc59b596645f2a
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
9 years agolibhusb: fix warning spelling (helps greppability)
Michal Bloch [Fri, 23 Oct 2015 15:50:27 +0000 (17:50 +0200)]
libhusb: fix warning spelling (helps greppability)

Make sure all failures have the same spelling.

This makes searching for errors easier, as search
for the correct word will now consistently find
all outstanding errors.

Change-Id: I8c31ff44aa8b64944923571cd41088dc4c6db53c
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
9 years agotests: improve transfer tests
Michal Bloch [Fri, 23 Oct 2015 12:10:47 +0000 (14:10 +0200)]
tests: improve transfer tests

Make transfer tests check
transferred bytes output value
returned by function

Change-Id: Id534a4d2015e49dc740054087a89168623997ba9
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
9 years agotests: add libhusb_{release,claim}_interface invalid param tests
Michal Bloch [Thu, 22 Oct 2015 11:08:52 +0000 (13:08 +0200)]
tests: add libhusb_{release,claim}_interface invalid param tests

Change-Id: I35eb285e7b2ca03831ec656a729b3776274f85ff
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
9 years agotests: add libhusb_get_string_descriptor_ascii test
Michal Bloch [Thu, 22 Oct 2015 10:49:17 +0000 (12:49 +0200)]
tests: add libhusb_get_string_descriptor_ascii test

Change-Id: Iacffc303ea24b1b5de528a556fb9a9f718a46687
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
9 years agotests: Add libhusb_close test
Michal Bloch [Mon, 19 Oct 2015 13:49:41 +0000 (15:49 +0200)]
tests: Add libhusb_close test

Change-Id: I2dbbcda98a01d053de80e39869d28e175205f6c2
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
9 years agotests: minor fixes
Michal Bloch [Thu, 15 Oct 2015 17:59:24 +0000 (19:59 +0200)]
tests: minor fixes

* make sure an array is always of the appropriate size
  by replacing a duplicate constant with a named identifier.
* initialize tested values for a more uniform distribution.

Change-Id: I2f195b25076b119deaf64f3c17b1ab6b4dee8200
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
9 years agotests: Run tests in verbose mode
Pawel Szewczyk [Tue, 20 Oct 2015 11:32:55 +0000 (13:32 +0200)]
tests: Run tests in verbose mode

As reaching failed tests log while cross compiling in separate environment
is not very convienient, tests are now run in verbose mode.

Change-Id: I9a4abb73f385517b024c8d927f5de2a2884243af
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
9 years agotests: Add attach kernel driver test
Stanislaw Wadas [Tue, 6 Oct 2015 14:00:40 +0000 (16:00 +0200)]
tests: Add attach kernel driver test

Change-Id: I3726a098b201c02afe7db4e03abaedc9da1f0c6d
Signed-off-by: Stanislaw Wadas <s.wadas@samsung.com>
9 years agotests: Add detach kernel driver test
Stanislaw Wadas [Tue, 6 Oct 2015 13:53:25 +0000 (15:53 +0200)]
tests: Add detach kernel driver test

Change-Id: I395b898b7ecc9e70e7b457bb98dca9c601ab5d89
Signed-off-by: Stanislaw Wadas <s.wadas@samsung.com>
9 years agotests: Add kernel driver active test
Stanislaw Wadas [Tue, 6 Oct 2015 13:45:04 +0000 (15:45 +0200)]
tests: Add kernel driver active test

Change-Id: I350eadabaaace5fa4251ad86bb6263d166492b20
Signed-off-by: Stanislaw Wadas <s.wadas@samsung.com>
9 years agotests: Add reset device test
Stanislaw Wadas [Tue, 6 Oct 2015 13:18:51 +0000 (15:18 +0200)]
tests: Add reset device test

Change-Id: I3ee71e6c6290d139f6d88b202577b763d2ba5d2c
Signed-off-by: Stanislaw Wadas <s.wadas@samsung.com>
9 years agotests: Add clear halt test
Stanislaw Wadas [Tue, 6 Oct 2015 11:39:21 +0000 (13:39 +0200)]
tests: Add clear halt test

Change-Id: I1a6dc5e6cba7cd61b948c05ca6ca8cdd1df9ee7c
Signed-off-by: Stanislaw Wadas <s.wadas@samsung.com>
9 years agotests: Add simple interrupt transfer test
Stanislaw Wadas [Tue, 6 Oct 2015 10:54:16 +0000 (12:54 +0200)]
tests: Add simple interrupt transfer test

Change-Id: Ife4a5398d5a495adadbb2d0594a524c81fd0eb8a
Signed-off-by: Stanislaw Wadas <s.wadas@samsung.com>
9 years agotests: Add simple release interface test
Stanislaw Wadas [Tue, 6 Oct 2015 10:47:49 +0000 (12:47 +0200)]
tests: Add simple release interface test

Change-Id: If01ef56f508b42aaa6b3e0936593dde54d6e9d24
Signed-off-by: Stanislaw Wadas <s.wadas@samsung.com>
9 years agotests: Add simple bulk transfer test
Stanislaw Wadas [Tue, 6 Oct 2015 09:59:09 +0000 (11:59 +0200)]
tests: Add simple bulk transfer test

Change-Id: Ie70dd75e8479306a4ee2d0140e94c40357061f4e
Signed-off-by: Stanislaw Wadas <s.wadas@samsung.com>
9 years agotests: Add get port numbers test
Stanislaw Wadas [Thu, 8 Oct 2015 08:25:31 +0000 (10:25 +0200)]
tests: Add get port numbers test

Change-Id: Ia5b4c568345f682feb78305354ef3164db805a7a
Signed-off-by: Stanislaw Wadas <s.wadas@samsung.com>
9 years agofix: add missing function implementation
Stanislaw Wadas [Tue, 6 Oct 2015 10:15:20 +0000 (12:15 +0200)]
fix: add missing function implementation

add libhusb_get_port_numbers() implementation

Change-Id: I66199bfdf173c3f234c168ce7dc3eb7e77f46a1b
Signed-off-by: Stanislaw Wadas <s.wadas@samsung.com>
9 years agotests: Add control_transfer test
Pawel Szewczyk [Thu, 1 Oct 2015 15:02:08 +0000 (17:02 +0200)]
tests: Add control_transfer test

Change-Id: I37ab9dd661028575c4f1e8a3708d4c8112dbc2a6
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
9 years agotests: Add claim_interface test
Pawel Szewczyk [Thu, 1 Oct 2015 15:02:04 +0000 (17:02 +0200)]
tests: Add claim_interface test

Change-Id: I19f000062c02f6d1f9d96c8bbadc72f33a5b9d02
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
9 years agotests: Add test of set_config
Pawel Szewczyk [Thu, 1 Oct 2015 12:06:46 +0000 (14:06 +0200)]
tests: Add test of set_config

Change-Id: I6d623eb2bdfb6c63f2216f20ba9b65052f92972f
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
9 years agotests: Add test of getting device by vid and pid
Pawel Szewczyk [Thu, 1 Oct 2015 11:26:13 +0000 (13:26 +0200)]
tests: Add test of getting device by vid and pid

Change-Id: Ieed35e48ae50b00ae8461b52792cb1877873c1fd
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
9 years agotests: Build and run tests
Pawel Szewczyk [Thu, 1 Oct 2015 09:26:17 +0000 (11:26 +0200)]
tests: Build and run tests

Add tests to CMake files and add running them in packaging. Add
BUILD_TESTS flag to CMake.

Change-Id: I3d374a9b1e9a80416231acc54c1b4e59613bae5e
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
9 years agotests: Add get_active_config test
Pawel Szewczyk [Tue, 29 Sep 2015 14:08:18 +0000 (16:08 +0200)]
tests: Add get_active_config test

Change-Id: I77b0c502d708e90edf332fda6eec8dda29210aa6
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
9 years agotests: Add tests of api functions related to devices
Pawel Szewczyk [Tue, 29 Sep 2015 14:14:28 +0000 (16:14 +0200)]
tests: Add tests of api functions related to devices

Change-Id: Ia958746d202ea89844015f8bb468bde3d6bd09ff
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
9 years agotests: Add test of getting device list
Pawel Szewczyk [Thu, 24 Sep 2015 13:41:30 +0000 (15:41 +0200)]
tests: Add test of getting device list

Change-Id: Ie84a227e75093c78ab7b561a3ff0674e18bf10f4
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
9 years agotests: Add getting device test
Pawel Szewczyk [Thu, 24 Sep 2015 12:54:15 +0000 (14:54 +0200)]
tests: Add getting device test

Change-Id: If61331c16b98393aa93f64433a8f73da157e4a5b
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
9 years agotests: Add device opening test
Pawel Szewczyk [Mon, 28 Sep 2015 11:55:18 +0000 (13:55 +0200)]
tests: Add device opening test

Change-Id: I899aaac5a216fc5d62f23674b0e83f927e64fd83
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
9 years agotests: Add basic tests
Pawel Szewczyk [Mon, 28 Sep 2015 11:57:34 +0000 (13:57 +0200)]
tests: Add basic tests

Change-Id: I410c5e796f3e7dfd095c1b877db2dd607714d2d5
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
9 years agotests: Add mock implementation of libusb
Pawel Szewczyk [Mon, 28 Sep 2015 11:39:42 +0000 (13:39 +0200)]
tests: Add mock implementation of libusb

Instead of using real libusb, we prepare simple mock version of the
library. It allows to control behavior of functions using cmocka,
creating environment for testing host capi.

Functions added here are mostly to be implemented with corresponding
test cases.

Change-Id: If9825c5dc2b24963cccc17ba023891b459fcf969
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
9 years agoinclude: Add libhusb_internal.h
Pawel Szewczyk [Mon, 28 Sep 2015 11:33:35 +0000 (13:33 +0200)]
include: Add libhusb_internal.h

For convenience of testing, internal data structures are moved to
separate header. They are still used only internally, but can be
included in tests as well.

Change-Id: I419f155cd5c5251a716f3b8e430074309664a2e5
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
9 years agoSave policy to file and restore from it during startup
Stanislaw Wadas [Fri, 4 Sep 2015 09:31:34 +0000 (11:31 +0200)]
Save policy to file and restore from it during startup

This change is needed as USD exits if no communication is processed.
As for now, all the policy was stored in USD process memory.
Now it is necassary to save it.
As for now store the policy in /run/usb-security-daemon.
This will cause reset of policy after each device reset.

Change-Id: Id8c8c5e00944f3530333a7410bda0250681d8baf
Signed-off-by: Stanislaw Wadas <s.wadas@samsung.com>
Signed-off-by: Jan Cybulski <j.cybulski@samsung.com>
9 years agoUSD: Add const identifier to functions that does not alter objects
Jan Cybulski [Fri, 31 Jul 2015 13:16:47 +0000 (15:16 +0200)]
USD: Add const identifier to functions that does not alter objects

Change-Id: I78049ca207c629b6ca7b020bf382509628f474a6
Signed-off-by: Jan Cybulski <j.cybulski@samsung.com>
9 years agoAdd some error reports in logs
Jan Cybulski [Mon, 27 Jul 2015 10:18:30 +0000 (12:18 +0200)]
Add some error reports in logs

This might be useful in debugging.

Change-Id: Id516a10e539717e769923084cf06d730b577998a
Signed-off-by: Jan Cybulski <j.cybulski@samsung.com>
9 years agoUSD: Add service for asking user for permission
Jan Cybulski [Fri, 31 Jul 2015 12:57:50 +0000 (14:57 +0200)]
USD: Add service for asking user for permission

Change-Id: Idc5f9f58e2804c37466a7ad58dee92d4414d53c8
Signed-off-by: Jan Cybulski <j.cybulski@samsung.com>
Signed-off-by: Stanislaw Wadas <s.wadas@samsung.com>
9 years agoUSD: Add dbus thread
Jan Cybulski [Tue, 14 Jul 2015 09:38:19 +0000 (11:38 +0200)]
USD: Add dbus thread

Add class for maintaining thread needed for dbus main loop.
Dbus communication is needed because popup mechanism used this IPC.

Change-Id: Ifd5c34dac3144906d156ad14e151f0684bfa790f
Signed-off-by: Jan Cybulski <j.cybulski@samsung.com>
Signed-off-by: Stanislaw Wadas <s.wadas@samsung.com>
9 years agofix: only two parameters returned by sscanf are valid
Stanislaw Wadas [Thu, 3 Sep 2015 09:44:03 +0000 (11:44 +0200)]
fix: only two parameters returned by sscanf are valid

Change-Id: I3decc002f0426bd1358aa1cec1de2cc797d01619
Signed-off-by: Stanislaw Wadas <s.wadas@samsung.com>
9 years agoAdd doxygen documentation
Stanislaw Wadas [Thu, 23 Jul 2015 14:39:20 +0000 (16:39 +0200)]
Add doxygen documentation

Change-Id: Ieb67d4889d2a567ee737d5ccc1f920bbd727dfe9
Signed-off-by: Stanislaw Wadas <s.wadas@samsung.com>
9 years agofix to allow -DBUILD_DOC_ONLY option run properly
Stanislaw Wadas [Tue, 28 Jul 2015 12:43:38 +0000 (14:43 +0200)]
fix to allow -DBUILD_DOC_ONLY option run properly

Change-Id: I4543eda5a655e55099c851388779952f4afc07cb
Signed-off-by: Stanislaw Wadas <s.wadas@samsung.com>
9 years agoFix parameter naming.
Stanislaw Wadas [Mon, 27 Jul 2015 15:45:17 +0000 (17:45 +0200)]
Fix parameter naming.

Change-Id: I47a2c2768f360c07c3166f38b8659979b633c3af
Signed-off-by: Stanislaw Wadas <s.wadas@samsung.com>
9 years agolog: add logs using dlog on libhusb apis
Taeyoung Kim [Wed, 29 Jul 2015 07:32:54 +0000 (16:32 +0900)]
log: add logs using dlog on libhusb apis

- When a developer uses the apis, they should check the error situation.
  When the developer uses IDE, dlog will be shown by default. Thus
  dlog is used to store logs of the apis

Change-Id: I279bd1b2104cff33420523141034dc20b1f0bd36
Signed-off-by: Taeyoung Kim <ty317.kim@samsung.com>
9 years agousd-commons: add dependency for smack and systemd-daemon
Taeyoung Kim [Fri, 24 Jul 2015 07:25:01 +0000 (16:25 +0900)]
usd-commons: add dependency for smack and systemd-daemon

- Build failure occurred on apps using libusb which uses libusd-commons
  due to the linking failure. Thus the dependency is needed

Signed-off-by: Taeyoung Kim <ty317.kim@samsung.com>
Change-Id: Ie0e079a4b3eed3297c00d00f3fdc682968143de2

9 years agoexample: fix example app to be built alone
Taeyoung Kim [Fri, 17 Jul 2015 09:26:41 +0000 (18:26 +0900)]
example: fix example app to be built alone

- Example app (sample/test app) should be built alone
  to check whether or not the library is working well.

Change-Id: I1a0f22fa5a40985703afda6d2220bb7888a944cd
Signed-off-by: Taeyoung Kim <ty317.kim@samsung.com>
9 years agopc: add capi-system-usbhost.pc file
Taeyoung Kim [Fri, 17 Jul 2015 09:07:53 +0000 (18:07 +0900)]
pc: add capi-system-usbhost.pc file

- PC file is necessary for other apps to use apis.
  Thus capi-system-usbhost.pc is added.
- The name of the library is changed from "libhusb"
  to "capi-system-usbhost". The name would not be changed
  and the keyword "husb" which is used for header file and
  each api is not related with the library name.

Change-Id: I5ebd6bbc7992dff85b446abd6a4e05bf0a6694fe
Signed-off-by: Taeyoung Kim <ty317.kim@samsung.com>