-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-
-SET(project_prefix "capi")
-SET(prefix "/usr")
-SET(version "0.0.1")
-SET(maintainer "Wootak Jung<wootak.jung@samsung.com>")
-SET(description "Telephony Core API")
-SET(service "telephony")
-SET(dependents "dlog tapi glib-2.0 \
- capi-base-common openssl1.1 capi-system-info \
- cynara-client cynara-session cynara-creds-self")
-SET(pc_dependents "capi-base-common tapi")
-
-SET(Services
- "application"
- "base"
- "content"
- "location"
- "media"
- "messaging"
- "network"
- "social"
- "telephony"
- "system"
- )
-
-#FILE(STRINGS config.cfg configs REGEX "^ *[^#]")
-FOREACH(lines ${configs})
-# MESSAGE(${lines})
- IF(${lines} MATCHES "([^=]*)=['\"](.*)['\"]")
- SET(key ${CMAKE_MATCH_1})
- SET(value ${CMAKE_MATCH_2})
-# MESSAGE("${key} -> ${value}")
- SET(${key} "${value}")
- ENDIF()
-ENDFOREACH(lines ${configs})
-
-LIST(FIND Services ${service} sfind)
-
-IF( ${sfind} EQUAL -1 )
- MESSAGE(FATAL_ERROR "Service must be one of ")
- FOREACH( s IN ${Services} )
- MESSAGE(FATAL_ERROR "[${s}]")
- ENDFOREACH( s IN ${Services} )
-ENDIF( ${sfind} EQUAL -1 )
-
-SET(fw_name "${project_prefix}-${service}")
-
-PROJECT(${fw_name})
-
-SET(CMAKE_INSTALL_PREFIX ${prefix})
-SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-SET(LIBDIR ${LIB_INSTALL_DIR})
-SET(VERSION ${version})
-
-SET(INC_DIR include)
-INCLUDE_DIRECTORIES(${INC_DIR})
+CMAKE_MINIMUM_REQUIRED(VERSION 3.9)
+PROJECT(capi-telephony C)
INCLUDE(FindPkgConfig)
-pkg_check_modules(${fw_name} REQUIRED ${dependents})
-FOREACH(flag ${${fw_name}_CFLAGS})
- SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-SET(ADDITIONAL_CFLAGS "-Wdeclaration-after-statement -Wmissing-declarations -Wredundant-decls -Wcast-align -Wno-array-bounds -Wno-empty-body -Wno-ignored-qualifiers -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-but-set-parameter -Wno-unused-but-set-variable")
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror")
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ADDITIONAL_CFLAGS}")
-SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
-
-IF("${ARCH}" STREQUAL "arm")
- ADD_DEFINITIONS("-DTARGET")
-ENDIF("${ARCH}" STREQUAL "arm")
-
-ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
-ADD_DEFINITIONS("-DTIZEN_DEBUG")
-
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIBDIR}")
-
-aux_source_directory(src SOURCES)
-ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
-
-TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
-
-SET_TARGET_PROPERTIES(${fw_name}
- PROPERTIES
- VERSION ${FULLVER}
- SOVERSION ${MAJORVER}
- CLEAN_DIRECT_OUTPUT 1
-)
-
-INSTALL(TARGETS ${fw_name} DESTINATION ${LIBDIR})
-INSTALL(
- DIRECTORY ${INC_DIR}/ DESTINATION include/${service}
- FILES_MATCHING
- PATTERN "*_private.h" EXCLUDE
- PATTERN "${INC_DIR}/*.h"
- )
+INCLUDE_DIRECTORIES(common)
+INCLUDE_DIRECTORIES(include)
-SET(PC_NAME ${fw_name})
-SET(PC_REQUIRED ${pc_dependents})
-SET(PC_LDFLAGS -l${fw_name})
+SET(EXTRA_FLAGS "-Wall -Werror -fvisibility=hidden")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_FLAGS}")
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_FLAGS} -std=c++11")
+SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
-CONFIGURE_FILE(
- capi-telephony.pc.in
- ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
- @ONLY
-)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIBDIR}/pkgconfig)
+PKG_CHECK_MODULES(pkgs REQUIRED dlog tapi glib-2.0 capi-base-common openssl1.1
+ capi-system-info cynara-client cynara-session cynara-creds-self)
+INCLUDE_DIRECTORIES(${pkgs_INCLUDE_DIRS})
+LINK_DIRECTORIES(${pkgs_LIBRARY_DIRS})
-#ADD_SUBDIRECTORY(test_src)
+FILE(GLOB SRCS src/*.c)
+ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LIBRARIES})
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${FULLVER} SOVERSION ${MAJORVER})
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR})
-IF(UNIX)
+FILE(GLOB HEADERS include/*.h)
+INSTALL(FILES ${HEADERS} DESTINATION ${HEADER_DIR})
-ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
-ADD_CUSTOM_COMMAND(
- DEPENDS clean
- COMMENT "distribution clean"
- COMMAND find
- ARGS .
- -not -name config.cmake -and \(
- -name tester.c -or
- -name Testing -or
- -name CMakeFiles -or
- -name cmake.depends -or
- -name cmake.check_depends -or
- -name CMakeCache.txt -or
- -name cmake.check_cache -or
- -name *.cmake -or
- -name Makefile -or
- -name core -or
- -name core.* -or
- -name gmon.out -or
- -name install_manifest.txt -or
- -name *.pc -or
- -name *~ \)
- | grep -v TC | xargs rm -rf
- TARGET distclean
- VERBATIM
-)
+SET(PC_REQUIRES "capi-base-common")
+CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
+INSTALL(FILES ${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
-ENDIF(UNIX)
+ADD_SUBDIRECTORY(tests)
\ No newline at end of file
+++ /dev/null
-<manifest>
- <request>
- <domain name="_"/>
- </request>
-</manifest>
+libdir=@LIB_INSTALL_DIR@
+includedir=@HEADER_DIR@
-# Package Information for pkg-config
-
-prefix=@PREFIX@
-exec_prefix=/usr
-libdir=@LIBDIR@
-includedir=/usr/include/telephony
-
-Name: @PC_NAME@
-Description: @PACKAGE_DESCRIPTION@
-Version: @VERSION@
-Requires: @PC_REQUIRED@
-Libs: -L${libdir} @PC_LDFLAGS@
+Name: @PROJECT_NAME@
+Description: Telephony Core API
+Version: @FULLVER@
+Requires: @PC_REQUIRES@
+Libs: -L${libdir} -l@PROJECT_NAME@
Cflags: -I${includedir}
#define TELEPHONY_FEATURE "http://tizen.org/feature/network.telephony"
+#ifdef API
+#undef API
+#endif
+#define API __attribute__((visibility("default")))
+
#ifdef LOG_TAG
#undef LOG_TAG
#endif
--- /dev/null
+<manifest>
+ <request>
+ <domain name="_" />
+ </request>
+</manifest>
-Name: capi-telephony
-Summary: Telephony Core API
-Version: 0.1.86
-Release: 1
-Group: System/Libraries
-License: Apache-2.0
-Source0: %{name}-%{version}.tar.gz
+Name: capi-telephony
+Version: 0.2.0
+Release: 0
+Summary: Telephony Core API
+
+Group: Telephony/API
+License: Apache-2.0
+Source0: %{name}-%{version}.tar.gz
+Source1001: %{name}.manifest
+
BuildRequires: cmake
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(tapi)
BuildRequires: pkgconfig(cynara-creds-self)
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
-
%if 0%{?gcov:1}
+BuildRequires: tar
BuildRequires: lcov
%endif
Telephony public API library
%package devel
-Summary: Telephony Core API
-Group: Developement/Libraries
-Requires: %{name} = %{version}-%{release}
+Summary: Telephony Core API
+Group: Telephony/Development
+Requires: %{name} = %{version}
+Requires: pkgconfig
%description devel
Telephony public API library (development library)
+%package unittests
+Summary: Test Programs for %{name}
+Group: Telephony/Testing
+
+%description unittests
+The %{name}-unittests pacakge contains programs for checking quality the %{name}.
+
%if 0%{?gcov:1}
%package gcov
-Summary: Telephony public API library(gcov)
-Group: Developement/Libraries
+Summary: Coverage Data of %{name}
+Group: Telephony/Testing
+
%description gcov
-gcov objects for coverage test
+The %{name}-gcov pacakge contains gcov objects
%endif
+%define tel_header_dir %{_includedir}/telephony
+
%prep
%setup -q
+cp %{SOURCE1001} ./%{name}.manifest
%build
-
%if 0%{?gcov:1}
export CFLAGS+=" -fprofile-arcs -ftest-coverage"
export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
%endif
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
- -DLIB_INSTALL_DIR=%{_libdir} \
- -DFULLVER=%{version} \
- -DMAJORVER=${MAJORVER}
-
-make %{?jobs:-j%jobs}
-
-%if 0%{?gcov:1}
-mkdir -p gcov-obj
-find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
-%endif
+%cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version} \
+ -DCMAKE_VERBOSE_MAKEFILE=OFF \
+ -DBIN_INSTALL_DIR:PATH=%{_bindir} \
+ -DHEADER_DIR:PATH=%{tel_header_dir} \
+ -DTEST_INSTALL_DIR:PATH=%{_bindir}/%{name}
+make %{?_smp_mflags}
%install
-rm -rf %{buildroot}
%make_install
%if 0%{?gcov:1}
-mkdir -p %{buildroot}%{_datadir}/gcov/obj
-install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
+find .. -name '*.gcno' | tar cf %{name}-gcov.tar -T -
+install -d -m 755 %{buildroot}%{_datadir}/gcov/obj
+tar xf %{name}-gcov.tar -C %{buildroot}%{_datadir}/gcov/obj
%endif
%post -p /sbin/ldconfig
-
%postun -p /sbin/ldconfig
%files
-%manifest capi-telephony.manifest
-%{_libdir}/libcapi-telephony.so.*
-%license LICENSE
-#%{_bindir}/telephony-test
+%manifest %{name}.manifest
+%{_libdir}/lib%{name}.so.*
+%license LICENSE.APLv2
%files devel
-%{_includedir}/telephony/telephony.h
-%{_includedir}/telephony/telephony_common.h
-%{_includedir}/telephony/telephony_call.h
-%{_includedir}/telephony/telephony_sim.h
-%{_includedir}/telephony/telephony_network.h
-%{_includedir}/telephony/telephony_modem.h
-%{_libdir}/pkgconfig/*.pc
-%{_libdir}/libcapi-telephony.so
+%{_libdir}/lib%{name}*.so
+%{_libdir}/pkgconfig/%{name}*.pc
+%{tel_header_dir}/telephony*.h
+
+%files unittests
+%manifest %{name}.manifest
+%{_bindir}/telephony-test
+%license LICENSE.APLv2
%if 0%{?gcov:1}
%files gcov
-%{_datadir}/gcov/obj/*
-%endif
\ No newline at end of file
+%{_datadir}/gcov/*
+%endif
}
/* LCOV_EXCL_STOP */
-int telephony_call_get_preferred_voice_subscription(telephony_h handle, telephony_call_preferred_voice_subs_e *call_sub)
+API int telephony_call_get_preferred_voice_subscription(telephony_h handle, telephony_call_preferred_voice_subs_e *call_sub)
{
int ret;
TapiHandle *tapi_h;
return TELEPHONY_ERROR_NONE;
}
-int telephony_call_get_call_list(telephony_h handle,
+API int telephony_call_get_call_list(telephony_h handle,
unsigned int *count, telephony_call_h **call_list)
{
int ret;
return TELEPHONY_ERROR_NONE;
}
-int telephony_call_release_call_list(unsigned int count, telephony_call_h **call_list)
+API int telephony_call_release_call_list(unsigned int count, telephony_call_h **call_list)
{
/* LCOV_EXCL_START */
int i;
/* LCOV_EXCL_STOP */
}
-int telephony_call_get_handle_id(telephony_call_h call_handle, unsigned int *handle_id)
+API int telephony_call_get_handle_id(telephony_call_h call_handle, unsigned int *handle_id)
{
/* LCOV_EXCL_START */
CHECK_TELEPHONY_SUPPORTED(TELEPHONY_FEATURE);
/* LCOV_EXCL_STOP */
}
-int telephony_call_get_number(telephony_call_h call_handle, char **number)
+API int telephony_call_get_number(telephony_call_h call_handle, char **number)
{
/* LCOV_EXCL_START */
CHECK_TELEPHONY_SUPPORTED(TELEPHONY_FEATURE);
/* LCOV_EXCL_STOP */
}
-int telephony_call_get_type(telephony_call_h call_handle,
+API int telephony_call_get_type(telephony_call_h call_handle,
telephony_call_type_e *type)
{
/* LCOV_EXCL_START */
/* LCOV_EXCL_STOP */
}
-int telephony_call_get_status(telephony_call_h call_handle,
+API int telephony_call_get_status(telephony_call_h call_handle,
telephony_call_status_e *status)
{
/* LCOV_EXCL_START */
/* LCOV_EXCL_STOP */
}
-int telephony_call_get_direction(telephony_call_h call_handle,
+API int telephony_call_get_direction(telephony_call_h call_handle,
telephony_call_direction_e *direction)
{
/* LCOV_EXCL_START */
/* LCOV_EXCL_STOP */
}
-int telephony_call_get_conference_status(telephony_call_h call_handle, bool *conference_status)
+API int telephony_call_get_conference_status(telephony_call_h call_handle, bool *conference_status)
{
/* LCOV_EXCL_START */
CHECK_TELEPHONY_SUPPORTED(TELEPHONY_FEATURE);
}
/* LCOV_EXCL_STOP */
-int telephony_set_noti_cb(telephony_h handle,
+API int telephony_set_noti_cb(telephony_h handle,
telephony_noti_e noti_id, telephony_noti_cb cb, void *user_data)
{
telephony_evt_cb_data *evt_cb_data = NULL;
return TELEPHONY_ERROR_NONE;
}
-int telephony_unset_noti_cb(telephony_h handle, telephony_noti_e noti_id)
+API int telephony_unset_noti_cb(telephony_h handle, telephony_noti_e noti_id)
{
telephony_evt_cb_data *evt_cb_data = NULL;
GSList *list = NULL;
return TELEPHONY_ERROR_NONE;
}
-int telephony_init(telephony_handle_list_s *list)
+API int telephony_init(telephony_handle_list_s *list)
{
char **cp_list;
int cp_count = 0;
return TELEPHONY_ERROR_NONE;
}
-int telephony_deinit(telephony_handle_list_s *list)
+API int telephony_deinit(telephony_handle_list_s *list)
{
unsigned int i;
return TELEPHONY_ERROR_NONE;
}
-int telephony_get_state(telephony_state_e *state)
+API int telephony_get_state(telephony_state_e *state)
{
int res = 0;
int value = 0;
return TELEPHONY_ERROR_NONE;
}
-int telephony_set_state_changed_cb(telephony_state_changed_cb callback, void *user_data)
+API int telephony_set_state_changed_cb(telephony_state_changed_cb callback, void *user_data)
{
int res = 0;
return TELEPHONY_ERROR_NONE;
}
-int telephony_unset_state_changed_cb(telephony_state_changed_cb callback)
+API int telephony_unset_state_changed_cb(telephony_state_changed_cb callback)
{
int res = 0;
#include "telephony_private.h"
/* LCOV_EXCL_START */
-int telephony_modem_get_imei(telephony_h handle, char **imei)
+API int telephony_modem_get_imei(telephony_h handle, char **imei)
{
GVariant *gv = NULL;
GError *gerr = NULL;
}
/* LCOV_EXCL_STOP */
-int telephony_modem_get_power_status(telephony_h handle,
+API int telephony_modem_get_power_status(telephony_h handle,
telephony_modem_power_status_e *status)
{
TapiHandle *tapi_h;
}
/* LCOV_EXCL_START */
-int telephony_modem_get_meid(telephony_h handle, char **meid)
+API int telephony_modem_get_meid(telephony_h handle, char **meid)
{
int ret = TELEPHONY_ERROR_NONE;
TapiHandle *tapi_h;
#define TELEPHONY_NETWORK_MCC_LEN 3
-int telephony_network_get_lac(telephony_h handle, int *lac)
+API int telephony_network_get_lac(telephony_h handle, int *lac)
{
int ret = TELEPHONY_ERROR_NONE;
TapiHandle *tapi_h;
return ret;
}
-int telephony_network_get_cell_id(telephony_h handle, int *cell_id)
+API int telephony_network_get_cell_id(telephony_h handle, int *cell_id)
{
int ret = TELEPHONY_ERROR_NONE;
TapiHandle *tapi_h;
return ret;
}
-int telephony_network_get_rssi(telephony_h handle, telephony_network_rssi_e *rssi)
+API int telephony_network_get_rssi(telephony_h handle, telephony_network_rssi_e *rssi)
{
int ret;
TapiHandle *tapi_h;
return ret;
}
-int telephony_network_get_roaming_status(telephony_h handle, bool *status)
+API int telephony_network_get_roaming_status(telephony_h handle, bool *status)
{
int ret;
int temp = 0;
return ret;
}
-int telephony_network_get_mcc(telephony_h handle, char **mcc)
+API int telephony_network_get_mcc(telephony_h handle, char **mcc)
{
int ret = TELEPHONY_ERROR_NONE;
char *plmn_str = NULL;
return ret;
}
-int telephony_network_get_mnc(telephony_h handle, char **mnc)
+API int telephony_network_get_mnc(telephony_h handle, char **mnc)
{
int ret = TELEPHONY_ERROR_NONE;
char *plmn_str = NULL;
return ret;
}
-int telephony_network_get_network_name(telephony_h handle, char **network_name)
+API int telephony_network_get_network_name(telephony_h handle, char **network_name)
{
int ret;
TapiHandle *tapi_h;
return ret;
}
-int telephony_network_get_network_name_option(telephony_h handle, telephony_network_name_option_e *network_name_option)
+API int telephony_network_get_network_name_option(telephony_h handle, telephony_network_name_option_e *network_name_option)
{
int ret;
int name_option = 0;
return ret;
}
-int telephony_network_get_type(telephony_h handle, telephony_network_type_e *network_type)
+API int telephony_network_get_type(telephony_h handle, telephony_network_type_e *network_type)
{
int ret;
int act;
return ret;
}
-int telephony_network_get_ps_type(telephony_h handle, telephony_network_ps_type_e *ps_type)
+API int telephony_network_get_ps_type(telephony_h handle, telephony_network_ps_type_e *ps_type)
{
int ret;
int service_type = 0;
return ret;
}
-int telephony_network_get_service_state(telephony_h handle, telephony_network_service_state_e *network_service_state)
+API int telephony_network_get_service_state(telephony_h handle, telephony_network_service_state_e *network_service_state)
{
int ret;
int service_type = 0;
return ret;
}
-int telephony_network_get_default_data_subscription(telephony_h handle,
+API int telephony_network_get_default_data_subscription(telephony_h handle,
telephony_network_default_data_subs_e *default_data_sub)
{
TapiHandle *tapi_h;
return ret;
}
-int telephony_network_get_default_subscription(telephony_h handle,
+API int telephony_network_get_default_subscription(telephony_h handle,
telephony_network_default_subs_e *default_sub)
{
TapiHandle *tapi_h;
return ret;
}
-int telephony_network_get_selection_mode(telephony_h handle, telephony_network_selection_mode_e *mode)
+API int telephony_network_get_selection_mode(telephony_h handle, telephony_network_selection_mode_e *mode)
{
int ret = TELEPHONY_ERROR_OPERATION_FAILED;
TapiHandle *tapi_h;
return ret;
}
-int telephony_network_get_tac(telephony_h handle, int *tac)
+API int telephony_network_get_tac(telephony_h handle, int *tac)
{
int ret = TELEPHONY_ERROR_NONE;
TapiHandle *tapi_h;
return ret;
}
-int telephony_network_get_system_id(telephony_h handle, int *sid)
+API int telephony_network_get_system_id(telephony_h handle, int *sid)
{
int ret = TELEPHONY_ERROR_NONE;
TapiHandle *tapi_h;
return ret;
}
-int telephony_network_get_network_id(telephony_h handle, int *nid)
+API int telephony_network_get_network_id(telephony_h handle, int *nid)
{
int ret = TELEPHONY_ERROR_NONE;
TapiHandle *tapi_h;
return ret;
}
-int telephony_network_get_base_station_id(telephony_h handle, int *bs_id)
+API int telephony_network_get_base_station_id(telephony_h handle, int *bs_id)
{
int ret = TELEPHONY_ERROR_NONE;
TapiHandle *tapi_h;
return ret;
}
-int telephony_network_get_base_station_latitude(telephony_h handle, int *bs_latitude)
+API int telephony_network_get_base_station_latitude(telephony_h handle, int *bs_latitude)
{
int ret = TELEPHONY_ERROR_NONE;
TapiHandle *tapi_h;
return ret;
}
-int telephony_network_get_base_station_longitude(telephony_h handle, int *bs_longitude)
+API int telephony_network_get_base_station_longitude(telephony_h handle, int *bs_longitude)
{
int ret = TELEPHONY_ERROR_NONE;
TapiHandle *tapi_h;
return ret;
}
-int telephony_network_get_signal_strength(telephony_h handle, int *dbm)
+API int telephony_network_get_signal_strength(telephony_h handle, int *dbm)
{
int ret;
TapiHandle *tapi_h;
/* LCOV_EXCL_STOP */
/* LCOV_EXCL_START */
-int telephony_sim_get_icc_id(telephony_h handle, char **icc_id)
+API int telephony_sim_get_icc_id(telephony_h handle, char **icc_id)
{
int error_code = TELEPHONY_ERROR_NONE;
TapiHandle *tapi_h;
}
/* LCOV_EXCL_STOP */
-int telephony_sim_get_operator(telephony_h handle, char **sim_operator)
+API int telephony_sim_get_operator(telephony_h handle, char **sim_operator)
{
int error_code = TELEPHONY_ERROR_NONE;
TelSimCardStatus_t sim_card_state = TAPI_SIM_STATUS_UNKNOWN;
return error_code;
}
-int telephony_sim_get_msin(telephony_h handle, char **msin)
+API int telephony_sim_get_msin(telephony_h handle, char **msin)
{
int error_code = TELEPHONY_ERROR_NONE;
TelSimCardStatus_t sim_card_state = TAPI_SIM_STATUS_UNKNOWN;
return error_code;
}
-int telephony_sim_get_spn(telephony_h handle, char **spn)
+API int telephony_sim_get_spn(telephony_h handle, char **spn)
{
int error_code = TELEPHONY_ERROR_NONE;
TelSimCardStatus_t sim_card_state = TAPI_SIM_STATUS_UNKNOWN;
return error_code;
}
-int telephony_sim_is_changed(telephony_h handle, bool *is_changed)
+API int telephony_sim_is_changed(telephony_h handle, bool *is_changed)
{
int card_changed = 0;
TelSimCardStatus_t sim_card_state = 0x00;
return error_code;
}
-int telephony_sim_get_state(telephony_h handle, telephony_sim_state_e *sim_state)
+API int telephony_sim_get_state(telephony_h handle, telephony_sim_state_e *sim_state)
{
TelSimCardStatus_t sim_card_state = TAPI_SIM_STATUS_UNKNOWN;
int error_code = TELEPHONY_ERROR_NONE;
return error_code;
}
-int telephony_sim_get_application_list(telephony_h handle, unsigned int *app_list)
+API int telephony_sim_get_application_list(telephony_h handle, unsigned int *app_list)
{
int error_code = TELEPHONY_ERROR_NONE;
TelSimCardStatus_t sim_card_state = TAPI_SIM_STATUS_UNKNOWN;
return error_code;
}
-int telephony_sim_get_subscriber_number(telephony_h handle, char **subscriber_number)
+API int telephony_sim_get_subscriber_number(telephony_h handle, char **subscriber_number)
{
int error_code = TELEPHONY_ERROR_NONE;
GError *gerr = NULL;
return error_code;
}
-int telephony_sim_get_subscriber_id(telephony_h handle, char **subscriber_id)
+API int telephony_sim_get_subscriber_id(telephony_h handle, char **subscriber_id)
{
int error_code = TELEPHONY_ERROR_NONE;
TelSimCardStatus_t sim_card_state = TAPI_SIM_STATUS_UNKNOWN;
return error_code;
}
-int telephony_sim_get_lock_state(telephony_h handle, telephony_sim_lock_state_e *lock_state)
+API int telephony_sim_get_lock_state(telephony_h handle, telephony_sim_lock_state_e *lock_state)
{
/* LCOV_EXCL_START */
TelSimCardStatus_t sim_card_state;
/* LCOV_EXCL_STOP */
}
-int telephony_sim_get_group_id1(telephony_h handle, char **gid1)
+API int telephony_sim_get_group_id1(telephony_h handle, char **gid1)
{
int error_code = TELEPHONY_ERROR_NONE;
TelSimCardStatus_t sim_card_state = TAPI_SIM_STATUS_UNKNOWN;
return error_code;
}
-int telephony_sim_get_call_forwarding_indicator_state(telephony_h handle, bool *state)
+API int telephony_sim_get_call_forwarding_indicator_state(telephony_h handle, bool *state)
{
int error_code = TELEPHONY_ERROR_NONE;
TelSimCardStatus_t sim_card_state = TAPI_SIM_STATUS_UNKNOWN;
+++ /dev/null
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(telephony-test C)
-SET(test "telephony-test")
-
-SET(test_src
- main.c
- menu.c
- call.c
- modem.c
- network.c
- sim.c
-)
-
-##Address-Space Layout Randomization
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE")
-SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
-
-ADD_EXECUTABLE(${test} ${test_src})
-TARGET_LINK_LIBRARIES(${test} ${fw_name} ${${fw_test}_LDFLAGS})
-INSTALL(TARGETS ${test} RUNTIME DESTINATION bin/)
--- /dev/null
+LINK_DIRECTORIES(${CMAKE_BINARY_DIR})
+
+SET(TELE_TEST "telephony-test")
+
+FILE(GLOB TEST_SRCS *.c)
+ADD_EXECUTABLE(${TELE_TEST} ${TEST_SRCS})
+TARGET_LINK_LIBRARIES(${TELE_TEST} ${PROJECT_NAME})
+SET_TARGET_PROPERTIES(${TELE_TEST} PROPERTIES COMPILE_FLAGS "-fPIE")
+INSTALL(TARGETS ${TELE_TEST} DESTINATION ${BIN_INSTALL_DIR})
static void _hex_dump(const char *pad, int size, const void *data)
{
- char buf[255] = {0, };
- char hex[4] = {0, };
int i;
+ char buf[255];
unsigned char *p;
if (size <= 0) {
}
p = (unsigned char *)data;
- snprintf(buf, 255, "%s%04X: ", pad, 0);
+ int len = snprintf(buf, 255, "%s%04X: ", pad, 0);
for (i = 0; i < size; i++) {
- snprintf(hex, 4, "%02X ", p[i]);
- strncat(buf, hex, strlen(hex));
+ len += snprintf(buf + len, sizeof(buf) - len, "%02X ", p[i]);
if ((i + 1) % 8 == 0) {
if ((i + 1) % 16 == 0) {
msg("%s", buf);
- memset(buf, 0, 255);
- snprintf(buf, 255, "%s%04X: ", pad, i + 1);
+ len = snprintf(buf, sizeof(buf), "%s%04X: ", pad, i + 1);
} else {
- strncat(buf, TAB_SPACE, strlen(TAB_SPACE));
+ len += snprintf(buf + len, sizeof(buf) - len, "%s", TAB_SPACE);
}
}
}