From: Kim Kibum Date: Sun, 29 Apr 2012 07:58:30 +0000 (+0900) Subject: upload tizen1.0 source X-Git-Tag: 2.0_alpha~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5918a4532bfbad025fc3591f7b19dc5629670abd;p=framework%2Fapi%2Fradio.git upload tizen1.0 source --- diff --git a/.gitignore b/.gitignore deleted file mode 100644 index a6d8f19..0000000 --- a/.gitignore +++ /dev/null @@ -1,26 +0,0 @@ -CMakeCache.txt -*/CMakeFiles/* -*.cmake -CMakeFiles* -*.a -*.so -Testing -cmake.depends -cmake.check_depends -cmake.check_cache -core -core.* -gmon.out -install_manifest.txt -*~ -.kdev_include_paths -src.kdev4 -.cproject -.project -tet_captured -tet_lock -*.pc -Makefile -*-test -*-test_* -*tester.c diff --git a/CMakeLists.txt b/CMakeLists.txt old mode 100755 new mode 100644 index 4bfc169..c99f3ec --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,7 @@ SET(INC_DIR include) INCLUDE_DIRECTORIES(${INC_DIR}) SET(dependents "dlog mm-radio capi-base-common") +SET(pc_dependents "capi-base-common") INCLUDE(FindPkgConfig) pkg_check_modules(${fw_name} REQUIRED ${dependents}) @@ -51,7 +52,7 @@ INSTALL( ) SET(PC_NAME ${fw_name}) -SET(PC_REQUIRED ${dependents}) +SET(PC_REQUIRED ${pc_dependents}) SET(PC_LDFLAGS -l${fw_name}) SET(PC_CFLAGS -I\${includedir}/media) diff --git a/capi-media-radio.pc.in b/capi-media-radio.pc.in index 773d667..a77de18 100644 --- a/capi-media-radio.pc.in +++ b/capi-media-radio.pc.in @@ -11,5 +11,4 @@ Description: @PACKAGE_DESCRIPTION@ Version: @VERSION@ Requires: @PC_REQUIRED@ Libs: -L${libdir} @PC_LDFLAGS@ -Cflags: -I${includedir} @PC_CFLAGS@ - +Cflags: -I${includedir} diff --git a/debian/changelog b/debian/changelog index 65611fc..0c078a9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +capi-media-radio (0.1.0-8) unstable; urgency=low + + * Support to get signal strength + + -- Kangho Hur Mon, 19 Mar 2012 17:44:22 +0900 + capi-media-radio (0.1.0-7) unstable; urgency=low * Use 'static' to local function which is limited to the current source file. diff --git a/debian/control b/debian/control index dca3075..e5523d9 100644 --- a/debian/control +++ b/debian/control @@ -7,12 +7,12 @@ Build-Depends: debhelper (>= 5), dlog-dev, libmm-radio-dev, capi-base-common-dev Package: capi-media-radio Architecture: any -Depends: ${shilbs:Depends}, ${misc:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends} Description: A Radio library in Tizen Native API Package: capi-media-radio-dev Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, capi-media-radio (= ${Source-Version}), dlog-dev, libmm-radio-dev, capi-base-common-dev +Depends: ${shlibs:Depends}, ${misc:Depends}, capi-media-radio (= ${Source-Version}), capi-base-common-dev Description: A Radio library in Tizen Native API (DEV) Package: capi-media-radio-dbg diff --git a/include/radio.h b/include/radio.h old mode 100755 new mode 100644 index 4a0462b..57dfaa6 --- a/include/radio.h +++ b/include/radio.h @@ -245,6 +245,17 @@ int radio_set_frequency(radio_h radio, int frequency); int radio_get_frequency(radio_h radio, int *frequency); /** + * @brief Gets the current signal strength of radio. + * @param[in] radio The handle to radio + * @param[out] strength The current signal strength [0 ~ 65535] (dbuV) + * @return 0 on success, otherwise a negative error value. + * @retval #RADIO_ERROR_NONE Successful + * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation + */ +int radio_get_signal_strength(radio_h radio, int *strength); + +/** * @brief Starts scanning radio signals, asynchronously * * @param[in] radio The handle to radio diff --git a/packaging/capi-media-radio.spec b/packaging/capi-media-radio.spec index cf67b0c..1d56ff6 100644 --- a/packaging/capi-media-radio.spec +++ b/packaging/capi-media-radio.spec @@ -1,35 +1,36 @@ Name: capi-media-radio Summary: A Radio library in Tizen Native API Version: 0.1.0 -Release: 1.1 +Release: 8 Group: TO_BE/FILLED_IN License: Apache-2.0 Source0: %{name}-%{version}.tar.gz -BuildRequires: cmake +BuildRequires: pkgconfig(dbus-glib-1) BuildRequires: pkgconfig(dlog) +BuildRequires: pkgconfig(vconf) BuildRequires: pkgconfig(mm-radio) BuildRequires: pkgconfig(capi-base-common) -Requires(post): /sbin/ldconfig -Requires(postun): /sbin/ldconfig +BuildRequires: cmake +BuildRequires: gettext-devel %description +A Radio library in Tizen Native API -%package devel -Summary: A Radio library in Tizen Native API (Development) -Group: TO_BE/FILLED_IN -Requires: %{name} = %{version}-%{release} +%package devel +Summary: A Radio library in Tizen Native API (Developement) +Group: TO_BE_FILLED +Requires: %{name} = %{version}-%{release} %description devel +A Radio library in Tizen Native API (Developement) %prep %setup -q - %build -FULLVER=%{version} -MAJORVER=`echo ${FULLVER} | cut -d '.' -f 1` -cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=${FULLVER} -DMAJORVER=${MAJORVER} +MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` +cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER} make %{?jobs:-j%jobs} @@ -38,16 +39,17 @@ make %{?jobs:-j%jobs} rm -rf %{buildroot} %make_install -%post -p /sbin/ldconfig +%post -%postun -p /sbin/ldconfig +%postun %files -%{_libdir}/libcapi-media-radio.so* - -%files devel -%{_includedir}/media/*.h -%{_libdir}/pkgconfig/*.pc - - +%defattr(-,root,root,-) +/usr/lib/libcapi-media-radio.so.* + +%files devel +%defattr(-,root,root,-) +/usr/include/media/radio.h +/usr/lib/pkgconfig/capi-media-radio.pc +/usr/lib/libcapi-media-radio.so diff --git a/src/radio.c b/src/radio.c index 9e4fe02..4b085b3 100644 --- a/src/radio.c +++ b/src/radio.c @@ -405,6 +405,24 @@ int radio_get_frequency(radio_h radio, int *frequency) } } +int radio_get_signal_strength(radio_h radio, int *strength) +{ + RADIO_INSTANCE_CHECK(radio); + radio_s * handle = (radio_s *) radio; + + int _strength; + int ret = mm_radio_get_signal_strength(handle->mm_handle, &_strength); + if(ret != MM_ERROR_NONE) + { + return __convert_error_code(ret,(char*)__FUNCTION__); + } + else + { + *strength = _strength; + return RADIO_ERROR_NONE; + } +} + int radio_scan_start(radio_h radio, radio_scan_updated_cb callback, void *user_data) { RADIO_INSTANCE_CHECK(radio);