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 -Wcast-qual")
+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")
*
* To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n
*
- * More details on featuring your application can be found from <a href="../org.tizen.mobile.native.appprogramming/html/ide_sdk_tools/feature_element.htm"><b>Feature Element</b>.</a>
+ * More details on featuring your application can be found from <a href="../org.tizen.gettingstarted/html/native/details/app_filtering_n.htm"><b>Feature List</b>.</a>
*/
/**
*
* To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n
*
- * More details on featuring your application can be found from <a href="../org.tizen.mobile.native.appprogramming/html/ide_sdk_tools/feature_element.htm"><b>Feature Element</b>.</a>
+ * More details on featuring your application can be found from <a href="../org.tizen.gettingstarted/html/native/details/app_filtering_n.htm"><b>Feature List</b>.</a>
*/
/**
*
* To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n
*
- * More details on featuring your application can be found from <a href="../org.tizen.mobile.native.appprogramming/html/ide_sdk_tools/feature_element.htm"><b>Feature Element</b>.</a>
+ * More details on featuring your application can be found from <a href="../org.tizen.gettingstarted/html/native/details/app_filtering_n.htm"><b>Feature List</b>.</a>
*/
/**
*
* To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n
*
- * More details on featuring your application can be found from <a href="../org.tizen.mobile.native.appprogramming/html/ide_sdk_tools/feature_element.htm"><b>Feature Element</b>.</a>
+ * More details on featuring your application can be found from <a href="../org.tizen.gettingstarted/html/native/details/app_filtering_n.htm"><b>Feature List</b>.</a>
*/
/**
*
* To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n
*
- * More details on featuring your application can be found from <a href="../org.tizen.mobile.native.appprogramming/html/ide_sdk_tools/feature_element.htm"><b>Feature Element</b>.</a>
+ * More details on featuring your application can be found from <a href="../org.tizen.gettingstarted/html/native/details/app_filtering_n.htm"><b>Feature List</b>.</a>
*/
#endif /* __TIZEN_TELEPHONY_INFORMATION_DOC_H__ */
* @{
*/
-/**
- * @brief Definition for the max length of call number
- * @since_tizen 2.4
- */
-#define TELEPHONY_CALL_NUMBER_LEN_MAX 82
-
-/**
- * @brief Definition for the max length of call count
- * @since_tizen 2.4
- */
-#define TELEPHONY_CALL_COUNT_LEN_MAX 6
-
/**
* @brief The call handle.
* @since_tizen 2.4
typedef struct telephony_call_info_s *telephony_call_h;
/**
+ * @deprecated Deprecated Since 2.4. Use #telephony_call_status_e instead.
+ *
* @brief Enumeration for the call state.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
typedef enum {
- TELEPHONY_CALL_STATE_IDLE, /**< There exists no calls. */
- TELEPHONY_CALL_STATE_CONNECTING, /**< There exists at least one call that is dialing, alerting or incoming */
- TELEPHONY_CALL_STATE_CONNECTED, /**< There exist active or held calls, and no calls are dialing, alerting or incoming*/
+ TELEPHONY_CALL_STATE_IDLE, /**< There exists no calls. */
+ TELEPHONY_CALL_STATE_CONNECTING, /**< There exists at least one call that is dialing, alerting or incoming */
+ TELEPHONY_CALL_STATE_CONNECTED, /**< There exist active or held calls, and no calls are dialing, alerting or incoming */
} telephony_call_state_e;
+/**
+ * @brief Enumeration for the call status.
+ * @since_tizen 2.4
+ */
+typedef enum {
+ TELEPHONY_CALL_STATUS_IDLE, /**< Idle status */
+ TELEPHONY_CALL_STATUS_ACTIVE, /**< Active status */
+ TELEPHONY_CALL_STATUS_HELD, /**< Held status */
+ TELEPHONY_CALL_STATUS_DIALING, /**< Dialing status */
+ TELEPHONY_CALL_STATUS_ALERTING, /**< Alerting status */
+ TELEPHONY_CALL_STATUS_INCOMING, /**< Incoming status */
+} telephony_call_status_e;
+
/**
* @brief Enumeration for the preferred voice call subscription.
* @since_tizen 2.4
} telephony_call_direction_e;
/**
+ * @deprecated Deprecated Since 2.4. Use #telephony_call_get_status instead.
+ *
* @brief Gets the voice call state of the telephony service.
* @details Determines if the voice call is connecting, connected, or idle.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/telephony
*
int telephony_call_get_voice_call_state(telephony_h handle, telephony_call_state_e *call_state);
/**
+ * @deprecated Deprecated Since 2.4. Use #telephony_call_get_status instead.
+ *
* @brief Gets the video call state of the telephony service.
* @details Determines if the video call is connecting, connected, or idle.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/telephony
*
int telephony_call_get_type(telephony_call_h call_handle, telephony_call_type_e *type);
/**
- * @brief Gets the call state.
+ * @brief Gets the call status.
*
* @since_tizen 2.4
*
* @param[in] call_handle The handle from #telephony_call_get_call_list()
- * @param[out] state The state of the call (#telephony_call_state_e)
+ * @param[out] status The status of the call (#telephony_call_status_e)
*
* @return @c 0 on success,
* otherwise a negative error value
* @pre The call handle should be obtained from #telephony_call_get_call_list()
* @post The call list should be released by using #telephony_call_release_call_list()
*/
-int telephony_call_get_state(telephony_call_h call_handle, telephony_call_state_e *state);
+int telephony_call_get_status(telephony_call_h call_handle, telephony_call_status_e *status);
/**
* @brief Gets whether the call is MO(Mobile Originated) call or MT(Mobile Terminated).
* @since_tizen 2.4
*
* @param[in] call_handle The handle from #telephony_call_get_call_list()
- * @param[out] conference_status The value whether this call is conference call or not.
+ * @param[out] conference_status The value whether the call is conference call or not.
* (true: Conference call, false: Single call)
*
* @return @c 0 on success,
/**
* @brief The Telephony API handle.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
typedef struct telephony_data *telephony_h;
* @brief The structure type for the list of handles to use the Telephony API.
* @remarks There are two handles in case of dual SIM device. \n
* In this case, handle[0] is mean Primary SIM and handle[1] is mean Secondary SIM.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
typedef struct {
unsigned int count; /**< Number of available handle */
/**
* @brief Enumeration for Telephony error.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
typedef enum {
TELEPHONY_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
/**
* @brief Enumeration for Telephony notification.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
typedef enum {
- TELEPHONY_NOTI_SIM_STATUS = 0x10, /**< Notification to be invoked when the SIM card state changes */
-
- TELEPHONY_NOTI_NETWORK_SERVICE_STATE = 0x20, /**< Notification to be invoked when the network service state changes */
- TELEPHONY_NOTI_NETWORK_CELLID, /**< Notification to be invoked when the cell ID changes */
- TELEPHONY_NOTI_NETWORK_ROAMING_STATUS, /**< Notification to be invoked when the roaming status changes */
- TELEPHONY_NOTI_NETWORK_SIGNALSTRENGTH_LEVEL, /**< Notification to be invoked when the signal strength changes */
- TELEPHONY_NOTI_NETWORK_SPN_NAME, /**< Notification to be invoked when the spn changes */
- TELEPHONY_NOTI_NETWORK_NETWORK_NAME, /**< Notification to be invoked when the network name changes */
- TELEPHONY_NOTI_NETWORK_NAME_OPTION, /**< Notification to be invoked when the network name option changes */
- TELEPHONY_NOTI_NETWORK_PS_TYPE, /**< Notification to be invoked when the ps type changes */
- TELEPHONY_NOTI_NETWORK_DEFAULT_DATA_SUBSCRIPTION, /**< Notification to be invoked when the default data subscription changes */
- TELEPHONY_NOTI_NETWORK_DEFAULT_SUBSCRIPTION, /**< Notification to be invoked when the default subscription changes */
-
- TELEPHONY_NOTI_VOICE_CALL_STATE = 0x30, /**< Notification to be invoked when the voice call state changes */
- TELEPHONY_NOTI_VIDEO_CALL_STATE, /**< Notification to be invoked when the video call state changes */
- TELEPHONY_NOTI_CALL_PREFERRED_VOICE_SUBSCRIPTION /**< Notification to be invoked when the preferred voice subscription changes */
+ TELEPHONY_NOTI_SIM_STATUS = 0x10, /**< Notification to be invoked when the SIM card state changes, '#telephony_sim_state_e' will be delivered in notification data */
+
+ TELEPHONY_NOTI_NETWORK_SERVICE_STATE = 0x20, /**< Notification to be invoked when the network service state changes, '#telephony_network_service_state_e' will be delivered in notification data */
+ TELEPHONY_NOTI_NETWORK_CELLID, /**< Notification to be invoked when the cell ID changes, 'cell_id(int)' will be delivered in notification data */
+ TELEPHONY_NOTI_NETWORK_ROAMING_STATUS, /**< Notification to be invoked when the roaming status changes, 'roaming_status(bool)' will be delivered in notification data */
+ TELEPHONY_NOTI_NETWORK_SIGNALSTRENGTH_LEVEL, /**< Notification to be invoked when the signal strength changes, '#telephony_network_rssi_e' will be delivered in notification data */
+ TELEPHONY_NOTI_NETWORK_NETWORK_NAME, /**< Notification to be invoked when the network name changes, 'network_name(char *)' wil be delivered in notification data (@b Since: 2.4) */
+ TELEPHONY_NOTI_NETWORK_PS_TYPE, /**< Notification to be invoked when the ps type changes, '#telephony_network_ps_type_e' will be delivered in notification data (@b Since: 2.4) */
+ TELEPHONY_NOTI_NETWORK_DEFAULT_DATA_SUBSCRIPTION, /**< Notification to be invoked when the default data subscription changes, '#telephony_network_default_data_subs_e' wil be delivered in notification data (@b Since: 2.4) */
+ TELEPHONY_NOTI_NETWORK_DEFAULT_SUBSCRIPTION, /**< Notification to be invoked when the default subscription changes, '#telephony_network_default_subs_e' will be delivered in notification data (@b Since: 2.4) */
+
+ TELEPHONY_NOTI_VOICE_CALL_STATE = 0x30, /**< Notification to be invoked when the voice call state changes, '#telephony_call_state_e' will be delivered in notification data (Deprecated Since 2.4. Use #TELEPHONY_NOTI_VOICE_CALL_STATUS_XXX instead.) */
+ TELEPHONY_NOTI_VIDEO_CALL_STATE, /**< Notification to be invoked when the video call state changes, '#telephony_call_state_e' will be delivered in notification data (Deprecated Since 2.4. Use #TELEPHONY_NOTI_VIDEO_CALL_STATUS_XXX instead.) */
+ TELEPHONY_NOTI_VOICE_CALL_STATUS_IDLE, /**< Notification to be invoked when a voice call is in idle status, 'handle_id(unsigned int)' will be delivered in notification data (@b Since: 2.4) */
+ TELEPHONY_NOTI_VOICE_CALL_STATUS_ACTIVE, /**< Notification to be invoked when a voice call is in active status, 'handle_id(unsigned int)' will be delivered in notification data (@b Since: 2.4) */
+ TELEPHONY_NOTI_VOICE_CALL_STATUS_HELD, /**< Notification to be invoked when a voice call is in held status, 'handle_id(unsigned int)' will be delivered in notification data (@b Since: 2.4) */
+ TELEPHONY_NOTI_VOICE_CALL_STATUS_DIALING, /**< Notification to be invoked when a voice call is in dialing status, 'handle_id(unsigned int)' will be delivered in notification data (@b Since: 2.4) */
+ TELEPHONY_NOTI_VOICE_CALL_STATUS_ALERTING, /**< Notification to be invoked when a voice call is in alerting status, 'handle_id(unsigned int)' will be delivered in notification data (@b Since: 2.4) */
+ TELEPHONY_NOTI_VOICE_CALL_STATUS_INCOMING, /**< Notification to be invoked when a voice call is in incoming status, 'handle_id(unsigned int)' will be delivered in notification data (@b Since: 2.4) */
+ TELEPHONY_NOTI_VIDEO_CALL_STATUS_IDLE, /**< Notification to be invoked when a video call is in idle status, 'handle_id(unsigned int)' will be delivered in notification data (@b Since: 2.4) */
+ TELEPHONY_NOTI_VIDEO_CALL_STATUS_ACTIVE, /**< Notification to be invoked when a video call is in active status, 'handle_id(unsigned int)' will be delivered in notification data (@b Since: 2.4) */
+ TELEPHONY_NOTI_VIDEO_CALL_STATUS_DIALING, /**< Notification to be invoked when a video call is in dialing status, 'handle_id(unsigned int)' will be delivered in notification data (@b Since: 2.4) */
+ TELEPHONY_NOTI_VIDEO_CALL_STATUS_ALERTING, /**< Notification to be invoked when a video call is in alerting status, 'handle_id(unsigned int)' will be delivered in notification data (@b Since: 2.4) */
+ TELEPHONY_NOTI_VIDEO_CALL_STATUS_INCOMING, /**< Notification to be invoked when a video call is in incoming status, 'handle_id(unsigned int)' will be delivered in notification data (@b Since: 2.4) */
+ TELEPHONY_NOTI_CALL_PREFERRED_VOICE_SUBSCRIPTION /**< Notification to be invoked when the preferred voice subscription changes, '#telephony_call_preferred_voice_subs_e' will be delivered in notification data (@b Since: 2.4) */
} telephony_noti_e;
/**
* @brief Called when the telephony state changes.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
typedef void (*telephony_noti_cb)(telephony_h handle, telephony_noti_e noti_id, void *data, void *user_data);
/**
* @brief Sets a callback function to be invoked when the telephony state changes.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/telephony
*
/**
* @brief Unsets a callback function.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/telephony
*
/**
* @brief Acquires the list of available handles to use the telephony API.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
* @remarks You will get two handles in case of dual SIM device. \n
* In this case, handle[0] is mean Primary SIM and handle[1] is mean Secondary SIM.
/**
* @brief Deinitializes the telephony handle list.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
* @param[in] list The handle list to be deinitialized
*
* @details The IMEI number is used by a GSM network to identify valid devices
* and therefore can be used for stopping a stolen phone from accessing that network.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/telephony
*
/**
* @brief Enumeration for RSSI (Receive Signal Strength Indicator).
* @details #TELEPHONY_NETWORK_RSSI_6 indicates the highest strength.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
typedef enum
{
/**
* @brief Enumeration for Network Type.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
typedef enum
{
/**
* @brief Enumeration for Network Service State.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
typedef enum
{
/**
* @brief Gets the LAC (Location Area Code) of the current network.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/telephony
*
/**
* @brief Gets the cell ID.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/telephony
*
/**
* @brief Gets the RSSI (Received Signal Strength Indicator).
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
- * @privilege %%%%%http://tizen.org/privilege/telephony
+ * @privilege %http://tizen.org/privilege/telephony
*
* @param[in] handle The handle from telephony_init()
* @param[out] rssi The Received Signal Strength Indicator \n
/**
* @brief Gets the roaming state.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/telephony
*
/**
* @brief Gets the MCC (Mobile Country Code) of the current registered network.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/telephony
*
/**
* @brief Gets the MNC (Mobile Network Code) of the current registered network.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/telephony
*
/**
* @brief Gets the name of the current registered network.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/telephony
*
/**
* @brief Gets the network service type of the current registered network.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/telephony
*
/**
* @brief Gets the current network state of the telephony service.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/telephony
*
#define TELEPHONY_FEATURE "http://tizen.org/feature/network.telephony"
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "CAPI_TELEPHONY"
+
+#define CHECK_INPUT_PARAMETER(arg) \
+ if (arg == NULL) { \
+ LOGE("INVALID_PARAMETER"); \
+ return TELEPHONY_ERROR_INVALID_PARAMETER; \
+ }
+
#define CHECK_TELEPHONY_SUPPORTED(feature_name) { \
bool telephony_supported = FALSE; \
if (!system_info_get_platform_bool(feature_name, &telephony_supported)) { \
} \
}
+/**
+ * @brief Definition for the max length of call number
+ * @since_tizen 2.4
+ */
+#define TELEPHONY_CALL_NUMBER_LEN_MAX 82
+
typedef struct {
GSList *evt_list;
struct tapi_handle *tapi_h;
*/
typedef struct {
unsigned int id; /**< The handle of the call */
- char number[TELEPHONY_CALL_NUMBER_LEN_MAX + 1]; /**< Current Calling number */
- telephony_call_type_e type; /**< Type of call (voice, data, emergency) */
- telephony_call_state_e state; /**< Current Call state */
- telephony_call_direction_e direction; /**< Current Call direction (MO, MT) */
+ char number[TELEPHONY_CALL_NUMBER_LEN_MAX + 1]; /**< Calling number */
+ telephony_call_type_e type; /**< Type of call (voice, video, emergency) */
+ telephony_call_status_e status; /**< Call Status */
+ telephony_call_direction_e direction; /**< Call direction (MO, MT) */
bool conference_status; /**< true: Conference call, false: Single call */
} telephony_call_info_s;
/**
* @brief Enumeration for the state of SIM card.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
typedef enum
{
* @since_tizen 2.4
*/
typedef enum {
- TELEPHONY_SIM_APP_TYPE_SIM = 0x01, /**< SIM(GSM) card */
- TELEPHONY_SIM_APP_TYPE_USIM = 0x02, /**< USIM card */
- TELEPHONY_SIM_APP_TYPE_CSIM = 0x04, /**< CDMA card */
+ TELEPHONY_SIM_APP_TYPE_SIM = 0x01, /**< SIM(GSM) Application */
+ TELEPHONY_SIM_APP_TYPE_USIM = 0x02, /**< USIM Application */
+ TELEPHONY_SIM_APP_TYPE_CSIM = 0x04, /**< CDMA Application */
+ TELEPHONY_SIM_APP_TYPE_ISIM = 0x08, /**< ISIM Application */
} telephony_sim_application_type_e;
* @brief Gets the Integrated Circuit Card IDentification (ICC-ID).
* @details The Integrated Circuit Card Identification number internationally identifies SIM cards.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/telephony
*
* @brief Gets the SIM Operator (MCC [3 digits] + MNC [2~3 digits]).
* @details The Operator is embedded in the SIM card.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/telephony
*
* @brief Gets the Mobile Subscription Identification Number (MSIN [9~10 digits]) of the SIM provider.
* @details This function gets Mobile Subscription Identification Number embedded in the SIM card.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/telephony
*
* @details This function gets Service Provider Name embedded in the SIM card.
* If this value is not stored in SIM card, @c NULL will be returned.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/telephony
*
/**
* @brief Checks whether the current SIM card is different from the previous SIM card.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/telephony
*
/**
* @brief Gets the state of the SIM.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/telephony
*
*
* @param[in] handle The handle from telephony_init()
* @param[out] app_list The masking value for below values
- * #TAPI_SIM_APP_TYPE_SIM 0x01 GSM Application
- * #TAPI_SIM_APP_TYPE_USIM 0x02 USIM Application
- * #TAPI_SIM_APP_TYPE_CSIM 0x04 CSIM Application
+ * #TELEPHONY_SIM_APP_TYPE_SIM 0x01 GSM Application
+ * #TELEPHONY_SIM_APP_TYPE_USIM 0x02 USIM Application
+ * #TELEPHONY_SIM_APP_TYPE_CSIM 0x04 CSIM Application
+ * #TELEPHONY_SIM_APP_TYPE_ISIM 0x08 ISIM Application
*
* @return @c 0 on success,
* otherwise a negative error value
* This value contains MSISDN related to the subscriber.
* If this value is not stored in SIM card, @c NULL will be returned.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/telephony
*
Name: capi-telephony
Summary: Telephony Core API
-Version: 0.1.32
+Version: 0.1.47
Release: 1
-Group: Telephony/Libraries
-License: Apache
+Group: System/Libraries
+License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
BuildRequires: cmake
BuildRequires: pkgconfig(dlog)
%{_includedir}/telephony/telephony_modem.h
%{_libdir}/pkgconfig/*.pc
%{_libdir}/libcapi-telephony.so
-
-
#include "telephony_call.h"
#include "telephony_private.h"
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "CAPI_TELEPHONY"
-
-#define CHECK_INPUT_PARAMETER(arg) \
- if (arg == NULL) { \
- LOGE("INVALID_PARAMETER"); \
- return TELEPHONY_ERROR_INVALID_PARAMETER; \
- }
-
static void _mapping_call_state(TelCallStates_t tapi_call_state, telephony_call_state_e *call_state)
{
switch (tapi_call_state) {
}
}
+static void _mapping_call_status(TelCallStates_t tapi_call_state,
+ telephony_call_status_e *status)
+{
+ switch (tapi_call_state) {
+ case TAPI_CALL_STATE_IDLE:
+ *status = TELEPHONY_CALL_STATUS_IDLE;
+ break;
+ case TAPI_CALL_STATE_ACTIVE:
+ *status = TELEPHONY_CALL_STATUS_ACTIVE;
+ break;
+ case TAPI_CALL_STATE_HELD:
+ *status = TELEPHONY_CALL_STATUS_HELD;
+ break;
+ case TAPI_CALL_STATE_DIALING:
+ *status = TELEPHONY_CALL_STATUS_DIALING;
+ break;
+ case TAPI_CALL_STATE_ALERT:
+ *status = TELEPHONY_CALL_STATUS_ALERTING;
+ break;
+ case TAPI_CALL_STATE_INCOMING:
+ case TAPI_CALL_STATE_WAITING:
+ *status = TELEPHONY_CALL_STATUS_INCOMING;
+ break;
+ default:
+ LOGE("Not handled call state: [%d]", tapi_call_state);
+ break;
+ }
+}
+
static void _voice_call_get_state_cb(TelCallStatus_t *tapi_status, void *user_data)
{
telephony_call_state_e *call_state = user_data;
telephony_call_info_s *call_info;
call_info = g_malloc0(sizeof(telephony_call_info_s));
+ if (!call_info)
+ return;
call_info->id = status->CallHandle;
call_info->type = status->CallType;
call_info->direction = status->bMoCall ? TELEPHONY_CALL_DIRECTION_MO : TELEPHONY_CALL_DIRECTION_MT;
call_info->conference_status = status->bConferenceState;
- _mapping_call_state(status->CallState, &call_info->state);
+ _mapping_call_status(status->CallState, &call_info->status);
strncpy(call_info->number, status->pNumber, TELEPHONY_CALL_NUMBER_LEN_MAX);
- LOGI("id[%d] number[%s] type[%d] state[%d] direction[%d] conference_status[%d]",
- call_info->id, call_info->number, call_info->type,
- call_info->state, call_info->direction, call_info->conference_status);
+ LOGI("id[%d] number[%s] type[%s] status[%s] direction[%s] conference_status[%s]",
+ call_info->id, call_info->number,
+ call_info->type == TELEPHONY_CALL_TYPE_VOICE ? "VOICE" :
+ call_info->type == TELEPHONY_CALL_TYPE_VIDEO ? "VIDEO" : "E911",
+ call_info->status == TELEPHONY_CALL_STATUS_IDLE ? "IDLE" :
+ call_info->status == TELEPHONY_CALL_STATUS_ACTIVE ? "ACTVIE" :
+ call_info->status == TELEPHONY_CALL_STATUS_HELD ? "HELD" :
+ call_info->status == TELEPHONY_CALL_STATUS_DIALING ? "DIALING" :
+ call_info->status == TELEPHONY_CALL_STATUS_ALERTING ? "ALERTING" :
+ call_info->status == TELEPHONY_CALL_STATUS_INCOMING ? "INCOMING" : "UNKNOWN",
+ call_info->direction == TELEPHONY_CALL_DIRECTION_MO ? "MO" : "MT",
+ call_info->conference_status ? "TRUE" : "FALSE");
*list = g_slist_append(*list, call_info);
}
if (g_slist_length(list)) {
*count = g_slist_length(list);
- *call_list = g_malloc0(*count * sizeof(telephony_call_info_s));
+ *call_list = g_malloc0(*count * sizeof(telephony_call_h));
+
tmp = list;
while (tmp) {
telephony_call_info_s *call_info = tmp->data;
- *call_list[call_index] = g_malloc0(sizeof(telephony_call_info_s));
- memcpy(*call_list[call_index], call_info, sizeof(telephony_call_info_s));
+ (*call_list)[call_index] = g_malloc0(sizeof(telephony_call_info_s));
+ memcpy((*call_list)[call_index], call_info, sizeof(telephony_call_info_s));
tmp = g_slist_next(tmp);
call_index++;
}
*count = 0;
*call_list = NULL;
}
+
return TELEPHONY_ERROR_NONE;
}
CHECK_TELEPHONY_SUPPORTED(TELEPHONY_FEATURE);
CHECK_INPUT_PARAMETER(call_list);
- for (i = 0; i < count; i++) {
- g_free((telephony_call_info_s *)*call_list[i]);
+ if (count > 0) {
+ for (i = 0; i < count; i++)
+ g_free((telephony_call_info_s *)(*call_list)[i]);
+ g_free(*call_list);
}
- g_free(*call_list);
+
return TELEPHONY_ERROR_NONE;
}
return TELEPHONY_ERROR_NONE;
}
-int telephony_call_get_state(telephony_call_h call_handle,
- telephony_call_state_e *state)
+int telephony_call_get_status(telephony_call_h call_handle,
+ telephony_call_status_e *status)
{
CHECK_TELEPHONY_SUPPORTED(TELEPHONY_FEATURE);
CHECK_INPUT_PARAMETER(call_handle);
- CHECK_INPUT_PARAMETER(state);
+ CHECK_INPUT_PARAMETER(status);
- *state = ((telephony_call_info_s *)call_handle)->state;
+ *status = ((telephony_call_info_s *)call_handle)->status;
return TELEPHONY_ERROR_NONE;
}
#include <dlog.h>
#include <tapi_common.h>
+#include <TelCall.h>
#include <TelSim.h>
#include <TelNetwork.h>
#include <TapiUtility.h>
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "CAPI_TELEPHONY"
-
#define CALLBACK_CALL(data) \
if (evt_cb_data->cb) { \
evt_cb_data->cb(evt_cb_data->handle, \
evt_cb_data->noti_id, data, evt_cb_data->user_data); \
}
-#define CHECK_INPUT_PARAMETER(arg) \
- if (arg == NULL) { \
- LOGE("INVALID_PARAMETER"); \
- return TELEPHONY_ERROR_INVALID_PARAMETER; \
+/* Handle deprecated noti_id for backward compatibility */
+#define CALLBACK_CALL_FOR_DEPRECATED_NOTI(evt_cb_data) \
+ if (evt_cb_data->noti_id == TELEPHONY_NOTI_VOICE_CALL_STATE) { \
+ telephony_call_state_e call_state; \
+ telephony_call_get_voice_call_state(evt_cb_data->handle, &call_state); \
+ CALLBACK_CALL(&call_state); \
+ return; \
+ } else if (evt_cb_data->noti_id == TELEPHONY_NOTI_VIDEO_CALL_STATE) { \
+ telephony_call_state_e call_state; \
+ telephony_call_get_video_call_state(evt_cb_data->handle, &call_state); \
+ CALLBACK_CALL(&call_state); \
+ return; \
}
typedef struct {
return TAPI_PROP_NETWORK_ROAMING_STATUS;
case TELEPHONY_NOTI_NETWORK_SIGNALSTRENGTH_LEVEL:
return TAPI_PROP_NETWORK_SIGNALSTRENGTH_LEVEL;
- case TELEPHONY_NOTI_NETWORK_SPN_NAME:
- return TAPI_PROP_NETWORK_SPN_NAME;
case TELEPHONY_NOTI_NETWORK_NETWORK_NAME:
return TAPI_PROP_NETWORK_NETWORK_NAME;
- case TELEPHONY_NOTI_NETWORK_NAME_OPTION:
- return TAPI_PROP_NETWORK_NAME_OPTION;
case TELEPHONY_NOTI_CALL_PREFERRED_VOICE_SUBSCRIPTION:
return TAPI_NOTI_CALL_PREFERRED_VOICE_SUBSCRIPTION;
case TELEPHONY_NOTI_NETWORK_PS_TYPE:
return TAPI_NOTI_NETWORK_DEFAULT_DATA_SUBSCRIPTION;
case TELEPHONY_NOTI_NETWORK_DEFAULT_SUBSCRIPTION:
return TAPI_NOTI_NETWORK_DEFAULT_SUBSCRIPTION;
+ case TELEPHONY_NOTI_VOICE_CALL_STATUS_IDLE:
+ return TAPI_NOTI_VOICE_CALL_STATUS_IDLE;
+ case TELEPHONY_NOTI_VOICE_CALL_STATUS_ACTIVE:
+ return TAPI_NOTI_VOICE_CALL_STATUS_ACTIVE;
+ case TELEPHONY_NOTI_VOICE_CALL_STATUS_HELD:
+ return TAPI_NOTI_VOICE_CALL_STATUS_HELD;
+ case TELEPHONY_NOTI_VOICE_CALL_STATUS_DIALING:
+ return TAPI_NOTI_VOICE_CALL_STATUS_DIALING;
+ case TELEPHONY_NOTI_VOICE_CALL_STATUS_ALERTING:
+ return TAPI_NOTI_VOICE_CALL_STATUS_ALERT;
+ case TELEPHONY_NOTI_VOICE_CALL_STATUS_INCOMING:
+ return TAPI_NOTI_VOICE_CALL_STATUS_INCOMING;
+ case TELEPHONY_NOTI_VIDEO_CALL_STATUS_IDLE:
+ return TAPI_NOTI_VIDEO_CALL_STATUS_IDLE;
+ case TELEPHONY_NOTI_VIDEO_CALL_STATUS_ACTIVE:
+ return TAPI_NOTI_VIDEO_CALL_STATUS_ACTIVE;
+ case TELEPHONY_NOTI_VIDEO_CALL_STATUS_DIALING:
+ return TAPI_NOTI_VIDEO_CALL_STATUS_DIALING;
+ case TELEPHONY_NOTI_VIDEO_CALL_STATUS_ALERTING:
+ return TAPI_NOTI_VIDEO_CALL_STATUS_ALERT;
+ case TELEPHONY_NOTI_VIDEO_CALL_STATUS_INCOMING:
+ return TAPI_NOTI_VIDEO_CALL_STATUS_INCOMING;
default:
return NULL;
}
int count = sizeof(voice_call_state_tbl) / sizeof(char *);
for (i = 0; i < count; i++) {
ret = tel_deregister_noti_event(tapi_h, voice_call_state_tbl[i]);
- if (ret != TAPI_API_SUCCESS) {
+ if (ret != TAPI_API_SUCCESS)
LOGE("Noti [%s] deregistration failed", voice_call_state_tbl[i]);
- }
}
} else if (noti_id == TELEPHONY_NOTI_VIDEO_CALL_STATE) {
int count = sizeof(video_call_state_tbl) / sizeof(char *);
for (i = 0; i < count; i++) {
ret = tel_deregister_noti_event(tapi_h, video_call_state_tbl[i]);
- if (ret != TAPI_API_SUCCESS) {
+ if (ret != TAPI_API_SUCCESS)
LOGE("Noti [%s] deregistration failed", video_call_state_tbl[i]);
- }
}
} else {
/* Deregister other notifications */
ret = tel_deregister_noti_event(tapi_h, tapi_noti);
- if (ret != TAPI_API_SUCCESS) {
+ if (ret != TAPI_API_SUCCESS)
LOGE("Noti [%s] deregistration failed", tapi_noti);
- }
}
return TELEPHONY_ERROR_NONE;
if (!g_strcmp0(evt_id, TAPI_NOTI_SIM_STATUS)) {
int sim_status = _mapping_sim_status(*(TelSimCardStatus_t *)data);
CALLBACK_CALL(&sim_status);
- } else if (!g_strcmp0(evt_id, TAPI_PROP_SIM_CALL_FORWARD_STATE)) {
- int call_forwading_state = *(int *)data;
- CALLBACK_CALL(&call_forwading_state);
} else if (!g_strcmp0(evt_id, TAPI_PROP_NETWORK_SERVICE_TYPE)) {
int service_state = _mapping_service_state(*(int *)data);
CALLBACK_CALL(&service_state);
} else if (!g_strcmp0(evt_id, TAPI_PROP_NETWORK_SIGNALSTRENGTH_LEVEL)) {
int rssi = *(int *)data;
CALLBACK_CALL(&rssi);
- } else if (!g_strcmp0(evt_id, TAPI_PROP_NETWORK_SPN_NAME)) {
- char *spn = data;
- CALLBACK_CALL(spn);
} else if (!g_strcmp0(evt_id, TAPI_PROP_NETWORK_NETWORK_NAME)) {
char *network_name = data;
CALLBACK_CALL(network_name);
- } else if (!g_strcmp0(evt_id, TAPI_PROP_NETWORK_NAME_OPTION)) {
- int network_name_option = *(int *)data;
- CALLBACK_CALL(&network_name_option);
} else if (!g_strcmp0(evt_id, TAPI_PROP_NETWORK_PS_TYPE)) {
int ps_type = *(int *)data;
CALLBACK_CALL(&ps_type);
int default_sub = *(int *)data;
CALLBACK_CALL(&default_sub);
} else if (!g_strcmp0(evt_id, TAPI_NOTI_VOICE_CALL_STATUS_IDLE)
- || !g_strcmp0(evt_id, TAPI_NOTI_VIDEO_CALL_STATUS_IDLE)) {
- /* Do not check IDLE state to prevent overriding in case of multi-party call */
- LOGI("Not handled IDLE call state");
+ || !g_strcmp0(evt_id, TAPI_NOTI_VIDEO_CALL_STATUS_IDLE)) {
+ TelCallStatusIdleNoti_t *noti = data;
+ unsigned int handle_id = noti->id;
+ CALLBACK_CALL_FOR_DEPRECATED_NOTI(evt_cb_data);
+ CALLBACK_CALL(&handle_id);
} else if (!g_strcmp0(evt_id, TAPI_NOTI_VOICE_CALL_STATUS_ACTIVE)
- || !g_strcmp0(evt_id, TAPI_NOTI_VIDEO_CALL_STATUS_ACTIVE)
- || !g_strcmp0(evt_id, TAPI_NOTI_VOICE_CALL_STATUS_HELD)) {
- telephony_call_state_e call_state = TELEPHONY_CALL_STATE_CONNECTED;
- CALLBACK_CALL(&call_state);
+ || !g_strcmp0(evt_id, TAPI_NOTI_VIDEO_CALL_STATUS_ACTIVE)) {
+ TelCallStatusActiveNoti_t *noti = data;
+ unsigned int handle_id = noti->id;
+ CALLBACK_CALL_FOR_DEPRECATED_NOTI(evt_cb_data);
+ CALLBACK_CALL(&handle_id);
+ } else if (!g_strcmp0(evt_id, TAPI_NOTI_VOICE_CALL_STATUS_HELD)) {
+ TelCallStatusHeldNoti_t *noti = data;
+ unsigned int handle_id = noti->id;
+ CALLBACK_CALL_FOR_DEPRECATED_NOTI(evt_cb_data);
+ CALLBACK_CALL(&handle_id);
} else if (!g_strcmp0(evt_id, TAPI_NOTI_VOICE_CALL_STATUS_DIALING)
- || !g_strcmp0(evt_id, TAPI_NOTI_VIDEO_CALL_STATUS_DIALING)
- || !g_strcmp0(evt_id, TAPI_NOTI_VOICE_CALL_STATUS_ALERT)
- || !g_strcmp0(evt_id, TAPI_NOTI_VIDEO_CALL_STATUS_ALERT)
- || !g_strcmp0(evt_id, TAPI_NOTI_VOICE_CALL_STATUS_INCOMING)
- || !g_strcmp0(evt_id, TAPI_NOTI_VIDEO_CALL_STATUS_INCOMING)) {
- telephony_call_state_e call_state = TELEPHONY_CALL_STATE_CONNECTING;
- CALLBACK_CALL(&call_state);
+ || !g_strcmp0(evt_id, TAPI_NOTI_VIDEO_CALL_STATUS_DIALING)) {
+ TelCallStatusDialingNoti_t *noti = data;
+ unsigned int handle_id = noti->id;
+ CALLBACK_CALL_FOR_DEPRECATED_NOTI(evt_cb_data);
+ CALLBACK_CALL(&handle_id);
+ } else if (!g_strcmp0(evt_id, TAPI_NOTI_VOICE_CALL_STATUS_ALERT)
+ || !g_strcmp0(evt_id, TAPI_NOTI_VIDEO_CALL_STATUS_ALERT)) {
+ TelCallStatusAlertNoti_t *noti = data;
+ unsigned int handle_id = noti->id;
+ CALLBACK_CALL_FOR_DEPRECATED_NOTI(evt_cb_data);
+ CALLBACK_CALL(&handle_id);
+ } else if (!g_strcmp0(evt_id, TAPI_NOTI_VOICE_CALL_STATUS_INCOMING)
+ || !g_strcmp0(evt_id, TAPI_NOTI_VIDEO_CALL_STATUS_INCOMING)) {
+ TelCallIncomingCallInfo_t *noti = data;
+ unsigned int handle_id = noti->CallHandle;
+ CALLBACK_CALL_FOR_DEPRECATED_NOTI(evt_cb_data);
+ CALLBACK_CALL(&handle_id);
} else if (!g_strcmp0(evt_id, TAPI_NOTI_CALL_PREFERRED_VOICE_SUBSCRIPTION)) {
int call_pref_voice_sub = *(int *)data;
CALLBACK_CALL(&call_pref_voice_sub);
CHECK_TELEPHONY_SUPPORTED(TELEPHONY_FEATURE);
CHECK_INPUT_PARAMETER(list);
-#if !GLIB_CHECK_VERSION(2,35,0)
+#if !GLIB_CHECK_VERSION(2, 35, 0)
/* Need g_type_init() to use tel_get_cp_name_list() */
g_type_init();
#endif
return TELEPHONY_ERROR_OPERATION_FAILED;
}
- while (cp_list[cp_count]) {
+ while (cp_list[cp_count])
cp_count++;
- }
list->count = cp_count;
list->handle = g_malloc(cp_count * sizeof(telephony_h));
#include "telephony_modem.h"
#include "telephony_private.h"
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "CAPI_TELEPHONY"
-
-#define CHECK_INPUT_PARAMETER(arg) \
- if (arg == NULL) { \
- LOGE("INVALID_PARAMETER"); \
- return TELEPHONY_ERROR_INVALID_PARAMETER; \
- }
-
int telephony_modem_get_imei(telephony_h handle, char **imei)
{
GVariant *gv = NULL;
#include <sys/types.h>
#include <unistd.h>
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "CAPI_TELEPHONY"
-
-#define CHECK_INPUT_PARAMETER(arg) \
- if (arg == NULL) { \
- LOGE("INVALID_PARAMETER"); \
- return TELEPHONY_ERROR_INVALID_PARAMETER; \
- }
-
int telephony_network_get_lac(telephony_h handle, int *lac)
{
int ret;
ret = tel_get_property_string(tapi_h, TAPI_PROP_NETWORK_PLMN, &plmn_str);
if (ret == TAPI_API_SUCCESS) {
- *mcc = malloc (sizeof(char) * (mcc_length + 1));
+ *mcc = malloc(sizeof(char) * (mcc_length + 1));
if (*mcc == NULL) {
LOGE("OUT_OF_MEMORY");
ret = TELEPHONY_ERROR_OUT_OF_MEMORY;
} else {
- memset (*mcc, 0x00, mcc_length + 1);
- strncpy (*mcc, plmn_str, mcc_length);
- free (plmn_str);
+ memset(*mcc, 0x00, mcc_length + 1);
+ strncpy(*mcc, plmn_str, mcc_length);
+ free(plmn_str);
LOGI("mcc:[%s]", *mcc);
ret = TELEPHONY_ERROR_NONE;
plmn_length = strlen(plmn_str);
LOGI("plmn:[%s], length:[%d]", plmn_str, plmn_length);
- *mnc = malloc (sizeof(char) * (plmn_length -3 + 1));
+ *mnc = malloc(sizeof(char) * (plmn_length -3 + 1));
if (*mnc == NULL) {
LOGE("OUT_OF_MEMORY");
ret = TELEPHONY_ERROR_OUT_OF_MEMORY;
} else {
- memset (*mnc, 0x00, (plmn_length -3 + 1));
- strncpy (*mnc, plmn_str + 3, (plmn_length -3 + 1));
- free (plmn_str);
+ memset(*mnc, 0x00, (plmn_length -3 + 1));
+ strncpy(*mnc, plmn_str + 3, (plmn_length -3 + 1));
+ free(plmn_str);
LOGI("mnc:[%s]", *mnc);
ret = TELEPHONY_ERROR_NONE;
ret = tel_get_network_default_data_subscription(tapi_h, &default_data_subscription);
if (ret == TAPI_API_SUCCESS) {
- switch(default_data_subscription) {
+ switch (default_data_subscription) {
case TAPI_NETWORK_DEFAULT_DATA_SUBS_SIM1:
*default_data_sub = TELEPHONY_NETWORK_DEFAULT_DATA_SUBS_SIM1;
break;
ret = tel_get_network_default_subscription(tapi_h, &default_subscription);
if (ret == TAPI_API_SUCCESS) {
- switch(default_subscription) {
+ switch (default_subscription) {
case TAPI_NETWORK_DEFAULT_SUBS_SIM1:
*default_sub = TELEPHONY_NETWORK_DEFAULT_SUBS_SIM1;
break;
#include "telephony_sim.h"
#include "telephony_private.h"
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "CAPI_TELEPHONY"
-
#define DBUS_SIM_STATUS_ERROR "SIM STATUS ERROR"
#define DBUS_SIM_NOT_FOUND "SIM NOT FOUND"
#define DBUS_SIM_PERM_BLOCKED "SIM PERM BLOCKED"
#define DBUS_SIM_RESPONSE_DATA_ERROR "SIM RESPONSE DATA ERROR"
#define DBUS_SIM_ACCESS_DENIED "No access rights"
-#define CHECK_INPUT_PARAMETER(arg) \
- if (arg == NULL) { \
- LOGE("INVALID_PARAMETER"); \
- return TELEPHONY_ERROR_INVALID_PARAMETER; \
- }
-
#define GET_SIM_STATUS(tapi_h, sim_card_state) { \
int card_changed = 0; \
int ret = tel_get_sim_init_info(tapi_h, &sim_card_state, &card_changed); \
CHECK_INPUT_PARAMETER(icc_id);
GET_SIM_STATUS(tapi_h, sim_card_state);
+ *icc_id = NULL;
if (sim_card_state == TAPI_SIM_STATUS_CARD_ERROR
|| sim_card_state == TAPI_SIM_STATUS_CARD_BLOCKED
|| sim_card_state == TAPI_SIM_STATUS_CARD_NOT_PRESENT
|| sim_card_state == TAPI_SIM_STATUS_CARD_REMOVED
|| sim_card_state == TAPI_SIM_STATUS_UNKNOWN) {
- *icc_id = NULL;
error_code = TELEPHONY_ERROR_SIM_NOT_AVAILABLE;
} else {
GError *gerr = NULL;
if (sync_gv) {
g_variant_get(sync_gv, "(is)", &result, &iccid);
if (result == TAPI_SIM_ACCESS_SUCCESS) {
- if (iccid != NULL && strlen(iccid) != 0) {
+ if (iccid != NULL && strlen(iccid) != 0)
*icc_id = g_strdup_printf("%s", iccid);
- }
+ else
+ *icc_id = g_strdup_printf("%s", "");
} else {
error_code = TELEPHONY_ERROR_OPERATION_FAILED;
- *icc_id = NULL;
}
g_free(iccid);
} else {
LOGE("g_dbus_conn failed. error (%s)", gerr->message);
error_code = _convert_dbus_errmsg_to_sim_error(gerr->message);
g_error_free(gerr);
- *icc_id = NULL;
}
}
CHECK_INPUT_PARAMETER(sim_operator);
GET_SIM_STATUS(tapi_h, sim_card_state);
+ *sim_operator = NULL;
if (sim_card_state != TAPI_SIM_STATUS_SIM_INIT_COMPLETED) {
- *sim_operator = NULL;
error_code = TELEPHONY_ERROR_SIM_NOT_AVAILABLE;
} else {
TelSimImsiInfo_t sim_imsi_info;
LOGI("SIM operator: [%s]", *sim_operator);
} else if (ret == TAPI_API_ACCESS_DENIED) {
LOGE("PERMISSION_DENIED");
- *sim_operator = NULL;
error_code = TELEPHONY_ERROR_PERMISSION_DENIED;
} else {
LOGE("OPERATION_FAILED");
- *sim_operator = NULL;
error_code = TELEPHONY_ERROR_OPERATION_FAILED;
}
}
CHECK_INPUT_PARAMETER(msin);
GET_SIM_STATUS(tapi_h, sim_card_state);
+ *msin = NULL;
if (sim_card_state != TAPI_SIM_STATUS_SIM_INIT_COMPLETED) {
- *msin = NULL;
error_code = TELEPHONY_ERROR_SIM_NOT_AVAILABLE;
} else {
TelSimImsiInfo_t sim_imsi_info;
*msin = g_strdup_printf("%s", sim_imsi_info.szMsin);
} else if (ret == TAPI_API_ACCESS_DENIED) {
LOGE("PERMISSION_DENIED");
- *msin = NULL;
error_code = TELEPHONY_ERROR_PERMISSION_DENIED;
} else {
LOGE("OPERATION_FAILED");
- *msin = NULL;
error_code = TELEPHONY_ERROR_OPERATION_FAILED;
}
}
CHECK_INPUT_PARAMETER(spn);
GET_SIM_STATUS(tapi_h, sim_card_state);
+ *spn = NULL;
if (sim_card_state == TAPI_SIM_STATUS_CARD_ERROR
|| sim_card_state == TAPI_SIM_STATUS_CARD_BLOCKED
|| sim_card_state == TAPI_SIM_STATUS_CARD_NOT_PRESENT
|| sim_card_state == TAPI_SIM_STATUS_CARD_REMOVED
|| sim_card_state == TAPI_SIM_STATUS_UNKNOWN) {
- *spn = NULL;
error_code = TELEPHONY_ERROR_SIM_NOT_AVAILABLE;
} else {
GError *gerr = NULL;
*spn = g_strdup_printf("%s", spn_str);
LOGI("SPN: [%s]", *spn);
} else {
- *spn = NULL;
+ *spn = g_strdup_printf("%s", "");
+ LOGI("SPN: [%s]", *spn);
}
- g_free(spn_str);
} else {
error_code = TELEPHONY_ERROR_OPERATION_FAILED;
- *spn = NULL;
}
+ g_free(spn_str);
} else {
LOGE("g_dbus_conn failed. error (%s)", gerr->message);
error_code = _convert_dbus_errmsg_to_sim_error(gerr->message);
g_error_free(gerr);
- *spn = NULL;
}
}
return error_code;
}
-int telephony_sim_get_application_list (telephony_h handle, unsigned int *app_list)
+int telephony_sim_get_application_list(telephony_h handle, unsigned int *app_list)
{
- TelSimCardType_t sim_card_type = TAPI_SIM_CARD_TYPE_UNKNOWN;
TapiHandle *tapi_h;
+ unsigned char tapi_app_list;
int ret;
CHECK_TELEPHONY_SUPPORTED(TELEPHONY_FEATURE);
CHECK_INPUT_PARAMETER(tapi_h);
CHECK_INPUT_PARAMETER(app_list);
- ret = tel_get_sim_type(tapi_h, &sim_card_type);
+ ret = tel_get_sim_application_list(tapi_h, &tapi_app_list);
if (ret == TAPI_API_ACCESS_DENIED) {
LOGE("PERMISSION_DENIED");
return TELEPHONY_ERROR_PERMISSION_DENIED;
return TELEPHONY_ERROR_OPERATION_FAILED;
}
- *app_list = 0;
-
- switch(sim_card_type) {
- case TAPI_SIM_CARD_TYPE_GSM:
- *app_list |= TELEPHONY_SIM_APP_TYPE_SIM;
- break;
- case TAPI_SIM_CARD_TYPE_USIM:
- *app_list |= TELEPHONY_SIM_APP_TYPE_USIM;
- break;
- case TAPI_SIM_CARD_TYPE_RUIM:
- *app_list |= TELEPHONY_SIM_APP_TYPE_CSIM;
- break;
- default:
- LOGI("Not supporting sim application type");
- break;
- }
-
- LOGI("Sim application list: [0x%x]", *app_list);
-
+ *app_list = (unsigned int)tapi_app_list;
+ LOGI("SIM Application List: [0x%x]", *app_list);
return TELEPHONY_ERROR_NONE;
}
CHECK_INPUT_PARAMETER(tapi_h);
CHECK_INPUT_PARAMETER(subscriber_number);
+ *subscriber_number = NULL;
sync_gv = g_dbus_connection_call_sync(tapi_h->dbus_connection,
DBUS_TELEPHONY_SERVICE, tapi_h->path, DBUS_TELEPHONY_SIM_INTERFACE,
"GetMSISDN", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, &gerr);
-
if (sync_gv) {
GVariantIter *iter = NULL;
g_variant_get(sync_gv, "(iaa{sv})", &result, &iter);
GVariant *value = NULL;
const gchar *str_value = NULL;
GVariantIter *iter_row = NULL;
+
while (g_variant_iter_next(iter, "a{sv}", &iter_row)) {
while (g_variant_iter_loop(iter_row, "{sv}", &key, &value)) {
if (!g_strcmp0(key, "number")) {
str_value = g_variant_get_string(value, NULL);
- if (strlen(str_value) != 0) {
+ if (str_value != NULL && strlen(str_value) != 0)
*subscriber_number = g_strdup_printf("%s", str_value);
- } else {
- *subscriber_number = NULL;
- }
}
}
g_variant_iter_free(iter_row);
/* Acquire only 1 subscriber number */
break;
}
+ if (!*subscriber_number)
+ *subscriber_number = g_strdup_printf("%s", "");
g_variant_iter_free(iter);
} else {
error_code = TELEPHONY_ERROR_OPERATION_FAILED;
- *subscriber_number = NULL;
}
} else {
LOGE("g_dbus_conn failed. error (%s)", gerr->message);
error_code = _convert_dbus_errmsg_to_sim_error(gerr->message);
g_error_free(gerr);
- *subscriber_number = NULL;
}
return error_code;
CHECK_INPUT_PARAMETER(subscriber_id);
GET_SIM_STATUS(tapi_h, sim_card_state);
+ *subscriber_id = NULL;
if (sim_card_state != TAPI_SIM_STATUS_SIM_INIT_COMPLETED) {
- *subscriber_id = NULL;
error_code = TELEPHONY_ERROR_SIM_NOT_AVAILABLE;
} else {
TelSimImsiInfo_t imsi_info;
*subscriber_id = g_malloc0(SHA256_DIGEST_LENGTH * 2 + 1);
for (i = 0; i < SHA256_DIGEST_LENGTH; i++)
- sprintf(*subscriber_id + (i * 2), "%02x", md[i]);
+ snprintf(*subscriber_id + (i * 2), 3, "%02x", md[i]);
LOGI("Subscriber ID: [%s]", *subscriber_id);
g_free(imsi);
} else if (error_code == TAPI_API_ACCESS_DENIED) {
LOGE("get_subscriber_id: PERMISSION_DENIED");
- *subscriber_id = NULL;
error_code = TELEPHONY_ERROR_PERMISSION_DENIED;
} else {
LOGE("get_subscriber_id: OPERATION_FAILED");
- *subscriber_id = NULL;
error_code = TELEPHONY_ERROR_OPERATION_FAILED;
}
}
#define LOG_TAG "CAPI_TELEPHONY_TEST"
static GMainLoop *event_loop;
+static telephony_handle_list_s handle_list;
static int network_noti_tbl[] = {
TELEPHONY_NOTI_NETWORK_SERVICE_STATE,
TELEPHONY_NOTI_NETWORK_CELLID,
TELEPHONY_NOTI_NETWORK_ROAMING_STATUS,
TELEPHONY_NOTI_NETWORK_SIGNALSTRENGTH_LEVEL,
- TELEPHONY_NOTI_NETWORK_SPN_NAME,
TELEPHONY_NOTI_NETWORK_NETWORK_NAME,
- TELEPHONY_NOTI_NETWORK_NAME_OPTION,
TELEPHONY_NOTI_NETWORK_PS_TYPE,
TELEPHONY_NOTI_NETWORK_DEFAULT_DATA_SUBSCRIPTION,
TELEPHONY_NOTI_NETWORK_DEFAULT_SUBSCRIPTION
};
static int call_noti_tbl[] = {
- TELEPHONY_NOTI_VOICE_CALL_STATE,
- TELEPHONY_NOTI_VIDEO_CALL_STATE,
+ TELEPHONY_NOTI_VOICE_CALL_STATUS_IDLE,
+ TELEPHONY_NOTI_VOICE_CALL_STATUS_ACTIVE,
+ TELEPHONY_NOTI_VOICE_CALL_STATUS_HELD,
+ TELEPHONY_NOTI_VOICE_CALL_STATUS_DIALING,
+ TELEPHONY_NOTI_VOICE_CALL_STATUS_ALERTING,
+ TELEPHONY_NOTI_VOICE_CALL_STATUS_INCOMING,
TELEPHONY_NOTI_CALL_PREFERRED_VOICE_SUBSCRIPTION
};
static void sim_noti_cb(telephony_h handle, telephony_noti_e noti_id, void *data, void *user_data)
{
LOGI("Noti!! SIM status: [%d]", *(int *)data);
-
-// g_main_loop_quit(event_loop);
}
static const char *_mapping_service_state(telephony_network_service_state_e service_state)
case TELEPHONY_NOTI_NETWORK_SIGNALSTRENGTH_LEVEL:
LOGI("Noti!!! Signal strength: [%d]", *(int *)data);
break;
- case TELEPHONY_NOTI_NETWORK_SPN_NAME:
- LOGI("Noti!!! SPN Name: [%s]", *(int *)data);
- break;
case TELEPHONY_NOTI_NETWORK_NETWORK_NAME:
LOGI("Noti!!! Network Name: [%s]", *(int *)data);
break;
- case TELEPHONY_NOTI_NETWORK_NAME_OPTION:
- LOGI("Noti!!! Name Option: [%s]", _mapping_name_option(*(int *)data));
- break;
case TELEPHONY_NOTI_NETWORK_PS_TYPE:
LOGI("Noti!!! PS Type: [%s]", _mapping_ps_type(*(int *)data));
break;
break;
}
-// g_main_loop_quit(event_loop);
}
static const char *_mapping_call_state(telephony_call_state_e call_state)
static void call_noti_cb(telephony_h handle, telephony_noti_e noti_id, void *data, void *user_data)
{
+ int ret_value;
+ telephony_call_h *call_list;
+ unsigned int count = 0;
+
+ if (noti_id == TELEPHONY_NOTI_CALL_PREFERRED_VOICE_SUBSCRIPTION) {
+ LOGI("Noti!!! Preferred Voice Subscription: [%d]", *(int *)data);
+ return;
+ }
+
switch (noti_id) {
- case TELEPHONY_NOTI_VOICE_CALL_STATE:
- LOGI("Noti!!! Voice Call state: [%s]", _mapping_call_state(*(int *)data));
+ case TELEPHONY_NOTI_VOICE_CALL_STATUS_IDLE:
+ LOGI("Noti!!! Voice Call Status Idle!!! [%d]", *(int *)data);
break;
- case TELEPHONY_NOTI_VIDEO_CALL_STATE:
- LOGI("Noti!!! Video Call state: [%s]", _mapping_call_state(*(int *)data));
+ case TELEPHONY_NOTI_VOICE_CALL_STATUS_ACTIVE:
+ LOGI("Noti!!! Voice Call Status Active!!! [%d]", *(int *)data);
break;
- case TELEPHONY_NOTI_CALL_PREFERRED_VOICE_SUBSCRIPTION:
- LOGI("Noti!!! Preferred Voice Subscription: [%d]", *(int *)data);
+ case TELEPHONY_NOTI_VOICE_CALL_STATUS_HELD:
+ LOGI("Noti!!! Voice Call Status Held!!! [%d]", *(int *)data);
+ break;
+ case TELEPHONY_NOTI_VOICE_CALL_STATUS_DIALING:
+ LOGI("Noti!!! Voice Call Status Dialing!!! [%d]", *(int *)data);
+ break;
+ case TELEPHONY_NOTI_VOICE_CALL_STATUS_ALERTING:
+ LOGI("Noti!!! Voice Call Status Alerting!!! [%d]", *(int *)data);
+ break;
+ case TELEPHONY_NOTI_VOICE_CALL_STATUS_INCOMING:
+ LOGI("Noti!!! Voice Call Status Incoming!!! [%d]", *(int *)data);
break;
default:
LOGE("Unknown noti");
break;
}
-// g_main_loop_quit(event_loop);
+ ret_value = telephony_call_get_call_list(handle_list.handle[0], &count, &call_list);
+ if (ret_value != TELEPHONY_ERROR_NONE) {
+ LOGE("telephony_call_get_call_list() failed!!!zz [0x%x]", ret_value);
+ } else {
+ int i;
+ unsigned int handle_id = 0;
+ char *number = NULL;
+ telephony_call_type_e type = 0;
+ telephony_call_status_e status = 0;
+ telephony_call_direction_e direction = 0;
+ bool conf_status = 0;
+
+ for (i = 0; i < count; i++) {
+ telephony_call_get_handle_id(call_list[i], &handle_id);
+ telephony_call_get_number(call_list[i], &number);
+ telephony_call_get_type(call_list[i], &type);
+ telephony_call_get_status(call_list[i], &status);
+ telephony_call_get_direction(call_list[i], &direction);
+ telephony_call_get_conference_status(call_list[i], &conf_status);
+ LOGI("id[%d] number[%s] type[%s] status[%s] direction[%s] conference_status[%s]",
+ handle_id, number,
+ type == TELEPHONY_CALL_TYPE_VOICE ? "VOICE" :
+ type == TELEPHONY_CALL_TYPE_VIDEO ? "VIDEO" : "E911",
+ status == TELEPHONY_CALL_STATUS_IDLE ? "IDLE" :
+ status == TELEPHONY_CALL_STATUS_ACTIVE ? "ACTVIE" :
+ status == TELEPHONY_CALL_STATUS_HELD ? "HELD" :
+ status == TELEPHONY_CALL_STATUS_DIALING ? "DIALING" :
+ status == TELEPHONY_CALL_STATUS_ALERTING ? "ALERTING" :
+ status == TELEPHONY_CALL_STATUS_INCOMING ? "INCOMING" : "UNKNOWN",
+ direction == TELEPHONY_CALL_DIRECTION_MO ? "MO" : "MT",
+ conf_status ? "TRUE" : "FALSE");
+ free(number);
+ }
+ telephony_call_release_call_list(count, &call_list);
+ }
+
}
int main()
{
- telephony_handle_list_s handle_list;
int ret_value, i;
/* SIM value */
unsigned int app_list = 0;
char *subscriber_number = NULL;
char *subscriber_id = NULL;
+ bool is_changed = FALSE;
/* Network value */
int cell_id = 0;
/* Modem value */
char *imei = NULL;
- telephony_modem_power_status_e status = 0;
+ telephony_modem_power_status_e power_status = 0;
/* Initialize handle */
ret_value = telephony_init(&handle_list);
LOGI("handle count: [%d]", handle_list.count);
/* SIM API */
+ ret_value = telephony_sim_is_changed(handle_list.handle[0], &is_changed);
+ if (ret_value != TELEPHONY_ERROR_NONE)
+ LOGE("telephony_sim_is_changed() failed!!! [%d]", ret_value);
+ else
+ LOGI("SIM is [%s]", is_changed ? "Changed" : "Not changed");
+
ret_value = telephony_sim_get_operator(handle_list.handle[0], &operator);
if (ret_value != TELEPHONY_ERROR_NONE) {
LOGE("telephony_sim_get_operator() failed!!! [%d]", ret_value);
}
ret_value = telephony_sim_get_state(handle_list.handle[0], &sim_state);
- if (ret_value != TELEPHONY_ERROR_NONE) {
+ if (ret_value != TELEPHONY_ERROR_NONE)
LOGE("telephony_sim_get_state() failed!!! [%d]", ret_value);
- } else {
+ else
LOGI("SIM state is [%s]", _mapping_sim_state(sim_state));
- }
ret_value = telephony_sim_get_application_list(handle_list.handle[0], &app_list);
if (ret_value != TELEPHONY_ERROR_NONE) {
LOGE("telephony_sim_get_type() failed!!! [%d]", ret_value);
} else {
- if (app_list & TELEPHONY_SIM_APP_TYPE_SIM) {
+ if (app_list & TELEPHONY_SIM_APP_TYPE_SIM)
LOGI("Sim type [SIM]");
- }
- if (app_list & TELEPHONY_SIM_APP_TYPE_USIM) {
+ if (app_list & TELEPHONY_SIM_APP_TYPE_USIM)
LOGI("Sim type [USIM]");
- }
- if (app_list & TELEPHONY_SIM_APP_TYPE_CSIM) {
+ if (app_list & TELEPHONY_SIM_APP_TYPE_CSIM)
LOGI("Sim type [CSIM]");
- }
}
ret_value = telephony_sim_get_subscriber_number(handle_list.handle[0], &subscriber_number);
/* Network API */
ret_value = telephony_network_get_cell_id(handle_list.handle[0], &cell_id);
- if (ret_value != TELEPHONY_ERROR_NONE) {
+ if (ret_value != TELEPHONY_ERROR_NONE)
LOGE("telephony_network_get_cell_id() failed!!! [%d]", ret_value);
- } else {
+ else
LOGI("Cell ID is [%d]", cell_id);
- }
ret_value = telephony_network_get_lac(handle_list.handle[0], &lac);
- if (ret_value != TELEPHONY_ERROR_NONE) {
+ if (ret_value != TELEPHONY_ERROR_NONE)
LOGE("telephony_network_get_lac() failed!!! [%d]", ret_value);
- } else {
+ else
LOGI("Location Area Code is [%d]", lac);
- }
ret_value = telephony_network_get_mcc(handle_list.handle[0], &mcc);
if (ret_value != TELEPHONY_ERROR_NONE) {
}
ret_value = telephony_network_get_network_name_option(handle_list.handle[0], &network_name_option);
- if (ret_value != TELEPHONY_ERROR_NONE) {
+ if (ret_value != TELEPHONY_ERROR_NONE)
LOGE("telephony_network_get_network_name_option() failed!!! [%d]", ret_value);
- } else {
+ else
LOGI("Network_name_option name is [%s]", _mapping_name_option(network_name_option));
- }
ret_value = telephony_network_get_roaming_status(handle_list.handle[0], &roaming_status);
- if (ret_value != TELEPHONY_ERROR_NONE) {
+ if (ret_value != TELEPHONY_ERROR_NONE)
LOGE("telephony_network_get_roaming_status() failed!!! [%d]", ret_value);
- } else {
+ else
LOGI("Network Roaming: [%s]", roaming_status ? "ON" : "OFF");
- }
ret_value = telephony_network_get_rssi(handle_list.handle[0], &rssi);
- if (ret_value != TELEPHONY_ERROR_NONE) {
+ if (ret_value != TELEPHONY_ERROR_NONE)
LOGE("telephony_network_get_rssi() failed!!! [%d]", ret_value);
- } else {
+ else
LOGI("Received Signal Strength Indicator is [%d]", rssi);
- }
ret_value = telephony_network_get_service_state(handle_list.handle[0], &service_state);
- if (ret_value != TELEPHONY_ERROR_NONE) {
+ if (ret_value != TELEPHONY_ERROR_NONE)
LOGE("telephony_network_get_service_state() failed!!! [%d]", ret_value);
- } else {
+ else
LOGI("Network service state is [%s]", _mapping_service_state(service_state));
- }
ret_value = telephony_network_get_type(handle_list.handle[0], &network_type);
- if (ret_value != TELEPHONY_ERROR_NONE) {
+ if (ret_value != TELEPHONY_ERROR_NONE)
LOGE("telephony_network_get_type() failed!!! [%d]", ret_value);
- } else {
+ else
LOGI("Network type is [%s]", _mapping_network_type(network_type));
- }
ret_value = telephony_network_get_ps_type(handle_list.handle[0], &ps_type);
- if (ret_value != TELEPHONY_ERROR_NONE) {
+ if (ret_value != TELEPHONY_ERROR_NONE)
LOGE("telephony_network_get_ps_type() failed!!! [%d]", ret_value);
- } else {
+ else
LOGI("PS type is [%s]", _mapping_ps_type(ps_type));
- }
ret_value = telephony_network_get_default_data_subscription(handle_list.handle[0], &default_data_sub);
- if (ret_value != TELEPHONY_ERROR_NONE) {
+ if (ret_value != TELEPHONY_ERROR_NONE)
LOGE("telephony_network_get_default_data_subscription() failed!!! [%d]", ret_value);
- } else {
+ else
LOGI("Default data subscription is [%s]", _mapping_default_data_sub(default_data_sub));
- }
ret_value = telephony_network_get_default_subscription(handle_list.handle[0], &default_sub);
- if (ret_value != TELEPHONY_ERROR_NONE) {
+ if (ret_value != TELEPHONY_ERROR_NONE)
LOGE("telephony_network_get_default_subscription() failed!!! [%d]", ret_value);
- } else {
+ else
LOGI("Default subscription is [%s]", _mapping_default_sub(default_sub));
- }
/* Call API */
ret_value = telephony_call_get_voice_call_state(handle_list.handle[0], &call_state);
- if (ret_value != TELEPHONY_ERROR_NONE) {
+ if (ret_value != TELEPHONY_ERROR_NONE)
LOGE("telephony_call_get_voice_call_state() failed!!! [%d]", ret_value);
- } else {
+ else
LOGI("Voice Call state is [%s]", _mapping_call_state(call_state));
- }
ret_value = telephony_call_get_video_call_state(handle_list.handle[0], &call_state);
- if (ret_value != TELEPHONY_ERROR_NONE) {
+ if (ret_value != TELEPHONY_ERROR_NONE)
LOGE("telephony_call_get_video_call_state() failed!!! [%d]", ret_value);
- } else {
+ else
LOGI("Video Call state is [%s]", _mapping_call_state(call_state));
- }
ret_value = telephony_call_get_preferred_voice_subscription(handle_list.handle[0], &call_sub);
- if (ret_value != TELEPHONY_ERROR_NONE) {
+ if (ret_value != TELEPHONY_ERROR_NONE)
LOGE("telephony_call_get_preferred_voice_subscription() failed!!! [%d]", ret_value);
- } else {
+ else
LOGI("Preferred voice subscription is [%s]", _mapping_preferred_voice_sub(call_sub));
- }
ret_value = telephony_call_get_call_list(handle_list.handle[0], &count, &call_list);
if (ret_value != TELEPHONY_ERROR_NONE) {
unsigned int handle_id = 0;
char *number = NULL;
telephony_call_type_e type = 0;
- telephony_call_state_e state = 0;
+ telephony_call_status_e status = 0;
telephony_call_direction_e direction = 0;
bool conf_status = 0;
telephony_call_get_handle_id(call_list[i], &handle_id);
telephony_call_get_number(call_list[i], &number);
telephony_call_get_type(call_list[i], &type);
- telephony_call_get_state(call_list[i], &state);
+ telephony_call_get_status(call_list[i], &status);
telephony_call_get_direction(call_list[i], &direction);
telephony_call_get_conference_status(call_list[i], &conf_status);
- LOGI("handle_id[%d] number[%s] type[%d] state[%d] direction[%d] conf_status[%d]",
- handle_id, number, type, state, direction, conf_status);
+ LOGI("handle_id[%d] number[%s] type[%d] status[%d] direction[%d] conf_status[%d]",
+ handle_id, number, type, status, direction, conf_status);
free(number);
}
telephony_call_release_call_list(count, &call_list);
free(imei);
}
- ret_value = telephony_modem_get_power_status(handle_list.handle[0], &status);
- if (ret_value != TELEPHONY_ERROR_NONE) {
+ ret_value = telephony_modem_get_power_status(handle_list.handle[0], &power_status);
+ if (ret_value != TELEPHONY_ERROR_NONE)
LOGE("telephony_modem_get_power_status() failed!!! [%d]", ret_value);
- } else {
- LOGI("Modem power status is [%d] (0=on,1=off,2=rst,3=low)", status);
- }
+ else
+ LOGI("Modem power status is [%d] (0=on,1=off,2=rst,3=low)", power_status);
/* set_noti_cb */
ret_value = telephony_set_noti_cb(handle_list.handle[0], TELEPHONY_NOTI_SIM_STATUS, sim_noti_cb, NULL);
if (ret_value != TELEPHONY_ERROR_NONE)
LOGE("Set noti failed!!!");
- for (i = 0; i < 4; i++) {
+ for (i = 0; i < (sizeof(network_noti_tbl) / sizeof(int)); i++) {
ret_value = telephony_set_noti_cb(handle_list.handle[0], network_noti_tbl[i], network_noti_cb, NULL);
if (ret_value != TELEPHONY_ERROR_NONE)
LOGE("Set noti failed!!!");
}
- for (i = 0; i < 3; i++) {
+ for (i = 0; i < (sizeof(call_noti_tbl) / sizeof(int)); i++) {
ret_value = telephony_set_noti_cb(handle_list.handle[0], call_noti_tbl[i], call_noti_cb, NULL);
if (ret_value != TELEPHONY_ERROR_NONE)
LOGE("Set noti failed!!!");
if (ret_value != TELEPHONY_ERROR_NONE)
LOGE("Unset noti failed!!!");
- for (i = 0; i < 4; i++) {
+ for (i = 0; i < (sizeof(network_noti_tbl) / sizeof(int)); i++) {
ret_value = telephony_unset_noti_cb(handle_list.handle[0], network_noti_tbl[i]);
if (ret_value != TELEPHONY_ERROR_NONE)
LOGE("Unset noti failed!!!");
}
- for (i = 0; i < 3; i++) {
+ for (i = 0; i < (sizeof(call_noti_tbl) / sizeof(int)); i++) {
ret_value = telephony_unset_noti_cb(handle_list.handle[0], call_noti_tbl[i]);
if (ret_value != TELEPHONY_ERROR_NONE)
LOGE("Unset noti failed!!!");
}
ret_value = telephony_deinit(&handle_list);
- if (ret_value != TELEPHONY_ERROR_NONE) {
+ if (ret_value != TELEPHONY_ERROR_NONE)
LOGE("Deinitialize failed!!!");
- }
return 0;
}