4 * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Ja-young Gu <jygu@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
23 * @ingroup TelephonyAPI
24 * @addtogroup PRODUCTIVITY_TAPI PRODUCTIVITY_TAPI
27 * @file ITapiProductivity.h
29 @brief This file serves as a "C" header file defines functions for Tapi productivity Services.\n
30 It contains a sample set of function prototypes that would be required by applications.
33 #ifndef _ITAPI_SERVICE_MODE_H_
34 #define _ITAPI_SERVICE_MODE_H_
36 #include <TelDefines.h>
38 #include <TelUtility.h>
44 #define TAPI_MAX_SERVICE_LINES 16 /** service information display max length */
45 #define TAPI_MAX_LCD_WIDTH 31 /** LCD max width for display */
47 #define MAX_FACTORY_OMISSION_AVOIDANCE_DATA_CNT 90
48 #define TAPI_FACTORY_WIFI_DATA_PDA_MAX 13 /** wifi data pda max length */
49 #define TAPI_FACTORY_WIFI_DATA_PC_MAX 16 /** wifi data pc max length */
50 #define TAPI_FACTORY_BT_MACADDRESS_MAX 6 /** BT mac address max length */
51 #define TAPI_FACTORY_PIN_CODE_MAX 4 /** pin code max length */
52 #define TAPI_FACTORY_LINE_SMS_ADDR_MAX 20 /** line sms address max length */
53 #define TAPI_FACTORY_LINE_SMS_DATA_MAX 256 /** line sms data max length */
54 #define TAPI_FACTORY_AXIS_MAX 4 /** axis max length */
55 #define TAPI_FACTORY_MEM_TOTAL_SIZE_MAX 8 /** max of memory total size */
56 #define TAPI_FACTORY_MEM_USED_SIZE_MAX 8 /** max of used memory size */
57 #define TAPI_FACTORY_MEM_FREE_SIZE_MAX 8 /** max of free memory size */
58 #define TAPI_FACTORY_TOUCH_STATUS_MAX 4 /** max if touch status */
60 #define SMS_NUM_SIZE 64 /**< sms number max size for factory dft*/
61 #define SMS_DATA_SIZE 255 /**< sms data max size for factory dft*/
64 * @enum tapi_service_mode_t
65 * This enumeration defines the service mode type for test mode.
68 TAPI_SVC_MODE_TEST_MANUAL = 0x01, /**< 0x01 : Manual test mode */
69 TAPI_SVC_MODE_NAM_EDIT, /**< 0x02 : Full NAM edit mode */
70 TAPI_SVC_MODE_MONITOR, /**<0x03 : Monitor screen mode */
71 TAPI_SVC_MODE_TEST_AUTO, /**< 0x04 : Auto test mode */
72 TAPI_SVC_MODE_NAM_BASIC_EDIT, /**< 0x05 : Basic NAM edit mode */
73 TAPI_SVC_MODE_PHONE_TEST, /**< 0x06 : Phone test mode ( just for the debugging ) */
74 TAPI_SVC_MODE_OPERATOR_SPECIFIC_TEST /**< 0x07: Specific test mode required by operator*/
75 } tapi_service_mode_t;
78 * @enum tapi_test_mode_sub_t
79 * This enumeration defines the test mode sub type.
82 TAPI_TESTMODE_ENTER = 0x1000, /**< 0x1000 : Testmode enter */
83 TAPI_TESTMODE_SW_VERSION_ENTER, /**< 0x1001 : SW_version enter */
84 TAPI_TESTMODE_FTA_SW_VERSION_ENTER, /**< 0x1002 : FTA SW version enter */
85 TAPI_TESTMODE_FTA_HW_VERSION_ENTER, /**< 0x1003 : FTA HW version enter */
86 TAPI_TESTMODE_ALL_VERSION_ENTER, /**< 0x1004 : All version enter */
87 TAPI_TESTMODE_BATTERY_INFO_ENTER, /**< 0x1005 : Battery Information enter */
88 TAPI_TESTMODE_CIPHERING_PROTECTION_ENTER, /**< 0x1006 : Ciphering protection enter */
89 TAPI_TESTMODE_INTEGRITY_PROTECTION_ENTER, /**< 0x1007 : Integrity protection enter */
90 TAPI_TESTMODE_IMEI_READ_ENTER, /**< 0x1008 : IMEI enter */
91 TAPI_TESTMODE_BLUETOOTH_TEST_ENTER, /**< 0x1009 : Bluetooth test enter */
92 TAPI_TESTMODE_VIBRATOR_TEST_ENTER, /**< 0x100A : Vibrator test enter */
93 TAPI_TESTMODE_MELODY_TEST_ENTER, /**< 0x100B : Melody test enter */
94 TAPI_TESTMODE_MP3_TEST_ENTER, /**< 0x100C : MP3 test enter */
95 TAPI_TESTMODE_FACTORY_RESET_ENTER, /**< 0x100D : Factory test enter */
96 TAPI_TESTMODE_FACTORY_PRECONFIG_ENTER, /**< 0x100E : Factory preconfig enter */
97 TAPI_TESTMODE_TFS4_EXPLORE_ENTER, /**< 0x100F : TFS4 explore enter */
98 TAPI_TESTMODE_RTC_TIME_DISPLAY_ENTER, /**< 0x1010 : RTC time display enter */
99 TAPI_TESTMODE_RSC_FILE_VERSION_ENTER, /**< 0x1011 : RSC file version enter */
100 TAPI_TESTMODE_USB_DRIVER_ENTER, /**< 0x1012 : USB driver enter */
101 TAPI_TESTMODE_USB_UART_DIAG_CONTROL_ENTER, /**< 0x1013 : USB UART diag control enter*/
102 TAPI_TESTMODE_RRC_VERSION_ENTER, /**< 0x1014 : RRC Version enter */
103 TAPI_TESTMODE_GPSONE_SS_TEST_ENTER, /**< 0x1015 : GPSone testmode enter */
104 TAPI_TESTMODE_BAND_SEL_ENTER, /**< 0x1016 : Band selection mode enter */
105 TAPI_TESTMODE_GCF_TESTMODE_ENTER, /**< 0x1017 : GCF Test mode enter */
106 TAPI_TESTMODE_GSM_FACTORY_AUDIO_LB_ENTER, /**< 0x1018 : GSM Factory Audio Loopback enter */
107 TAPI_TESTMODE_FACTORY_VF_TEST_ENTER, /**< 0x1019 : VF ADC Test mode enter */
108 TAPI_TESTMODE_TOTAL_CALL_TIME_INFO_ENTER, /**< 0x101A : Display Total Call time info enter */
109 TAPI_TESTMODE_SELLOUT_SMS_ENABLE_ENTER, /**< 0x101B : Sell_Out_SMS_Enable_enter */
110 TAPI_TESTMODE_SELLOUT_SMS_DISABLE_ENTER, /**< 0x101C : Sell_Out_SMS_Disable_enter */
111 TAPI_TESTMODE_SELLOUT_SMS_TEST_MODE_ON, /**< 0x101D : Sell_Out_SMS_Test_Mode_ON */
112 TAPI_TESTMODE_SELLOUT_SMS_PRODUCT_MODE_ON, /**< 0x101E : Sell_Out_SMS_Product_Mode_ON */
113 TAPI_TESTMODE_GET_SELLOUT_SMS_INFO_ENTER, /**< 0x101F Get Sellout SMS info enter */
114 TAPI_TESTMODE_WCDMA_SET_CHANNEL_ENTER, /**< 0x1020 WCDMA Set Channel Enter */
115 TAPI_TESTMODE_GPRS_ATTACH_MODEM_ENTER, /**< 0x1021 GPRS Attach mode Enter */
117 /* In case of SVC_MODE = SM_NAM in CDMA */
118 TAPI_SVC_MODE_NAM_CDMA_EDIT = 0x2001, /**< 0x2001 : NAM Full Edit Mode */
119 TAPI_SVC_MODE_NAM_CDMA_BASIC_EDIT, /**< 0x2002 : NAM Basic Edit Mode */
120 TAPI_SVC_MODE_NAM_CDMA_ADVANCED_EDIT, /**< 0x2003 : NAM Advanced Edit Mode */
122 TAPI_TESTMODE_SUB_MODE_MAX
123 } tapi_test_mode_sub_t;
126 * @enum tapi_service_mode_reset_t
127 * This enumeration defines the reset mode type for test mode.
130 TAPI_SVC_MODE_END_NO_ACTION = 0x00, /**< 0x00 : RESET_NO_ACTION */
131 TAPI_SVC_MODE_END_PHONE_ONLY_RESET, /**< 0x01 : RESET_PHONE_ONLY_REQUIRED */
132 TAPI_SVC_MODE_END_BOTH_RESET /**< 0x02 : RESET_BOTH_REQUIRED */
133 } tapi_service_mode_reset_t;
136 * @enum tapi_service_mode_debug_cp_dump_t
137 * This enumeration defines the cp dump type.
140 TAPI_SVC_DBG_CP_DUMP_TARGET_ALL = 0x00, /**< cp dump option - all */
141 TAPI_SVC_DBG_CP_DUMP_TARGET_MSG, /**< cp dump option - message */
142 TAPI_SVC_DBG_CP_DUMP_TARGET_LOG, /**< cp dump option - log */
143 TAPI_SVC_DBG_CP_DUMP_TARGET_LOG2, /**< cp dump option - log2 */
144 TAPI_SVC_DBG_CP_DUMP_TARGET_RAM_DUMP, /**< cp dump option - ram dump */
145 TAPI_SVC_DBG_CP_DUMP_TARGET_MAX /**< RFU */
146 } tapi_service_mode_debug_cp_dump_t;
149 * @enum tapi_service_mode_debug_ap_dump_t
150 * This enumeration defines the ap dump type.
153 TAPI_SVC_DBG_AP_DUMP_TARGET_RIL = 0x01, /**< ap dump option - ril */
154 TAPI_SVC_DBG_AP_DUMP_TARGET_SYSTEM, /**< ap dump option - system */
155 TAPI_SVC_DBG_AP_DUMP_TARGET_MAX /**< ap dump -RFU */
156 } tapi_service_mode_debug_ap_dump_t;
159 * @enum tapi_device_id_t
160 * This enumeration defines the device information for test mode.
163 TAPI_DEVICE_VIBRATION = 0x01, /**< vibration */
164 TAPI_DEVICE_BACKLIGHT, /**< back light */
165 TAPI_DEVICE_FRONTLCD, /**< front lcd */
166 TAPI_DEVICE_KEYLED, /**< key led */
167 TAPI_DEVICE_ALERTLED /**< alerted */
171 * @enum tapi_device_status_t
172 * This enumeration defines the device status.
175 TAPI_DEVICE_OFF = 0x00, /**< off */
176 TAPI_DEVICE_ON, /**< on */
177 TAPI_DEVICE_AUTO /**< auto */
178 } tapi_device_status_t;
181 * @enum tapi_keypad_t
182 * This enumeration defines the keypad requirement.
185 KEYPAD_NOT_NEEDED = 0x00, /**< keypad required */
186 KEYPAD_NEEDED /**< keypad not required */
190 * @enum tapi_svcmode_event_t
191 * This enumeration defines the service mode event type for test mode.
194 TAPI_SVCMODE_EVENT_SVCMODE_START = 0, /**< start */
195 TAPI_SVCMODE_EVENT_SVCMODE_END, /**< end */
196 TAPI_SVCMODE_EVENT_SVCMODE_CHANGE, /** changed */
197 TAPI_SVCMODE_EVENT_SVCMODE_SCREEN_CFG, /**< screen config */
198 TAPI_SVCMODE_EVENT_SVCMODE_DISP_SCREEN, /**< display screen */
199 TAPI_SVCMODE_EVENT_SVCMODE_DEVICE_TEST /**< device test */
200 } tapi_svcmode_event_t;
203 * @enum TelFactoryDftSmsOption_t
204 * This enumeration defines the service mode type for test mode.
207 TAPI_FACTORY_DFT_SMS_INBOX, /**< sms inbox */
208 TAPI_FACTORY_DFT_SMS_DRAFTS, /**< sms draft */
209 TAPI_FACTORY_DFT_SMS_OUTBOX, /**< sms outbox */
210 TAPI_FACTORY_DFT_SMS_SENTBOX /**< sent box */
211 } TelFactoryDftSmsOption_t;
214 TAPI_FACTORY_OMISSION_AVOIDANCE_ITEM_WRITE = 0x01,
215 TAPI_FACTORY_OMISSION_AVOIDANCE_ITEM_WRITE_FULL,
216 TAPI_FACTORY_OMISSION_AVOIDANCE_LOG_ERASE_FULL,
217 TAPI_FACTORY_OMISSION_AVOIDANCE_FAILDATA_WRITE,
218 TAPI_FACTORY_OMISSION_AVOIDANCE_FAILDATA_WRITE_FULL,
219 } tapi_factory_omission_avoidance_write_cmd_t;
222 TAPI_FACTORY_OMISSION_AVOIDANCE_ITEM_READ = 0x01,
223 TAPI_FACTORY_OMISSION_AVOIDANCE_ITEM_READ_FULL,
224 TAPI_FACTORY_OMISSION_AVOIDANCE_LOG_READ_FULL,
225 TAPI_FACTORY_OMISSION_AVOIDANCE_FAILDATA_READ,
226 TAPI_FACTORY_OMISSION_AVOIDANCE_FAILDATA_READ_FULL,
227 } tapi_factory_omission_avoidance_read_cmd_t;
230 * This structure contains service mode end information.
233 tapi_service_mode_t service_mode; /**< service mode */
234 tapi_service_mode_reset_t reset; /**< service reset mode */
235 } tapi_service_mode_end_t;
238 * This structure contains screen configuration information.
241 int line_number; /**< line number */
242 tapi_keypad_t keypad; /**< keypad requirement */
243 } tapi_screen_config_t;
246 * This structure contains string information to display.
249 char line; /**< line to display */
250 char string[TAPI_MAX_LCD_WIDTH + 1 ]; /**< string information */
251 int reverse; /**< reverse mode */
252 } tapi_service_string_info_t;
255 * This structure contains display information.
259 char num_of_lines; /**< number of line to display */
260 tapi_service_string_info_t display[ TAPI_MAX_SERVICE_LINES ]; /**< string information */
261 } tapi_service_display_info_t;
264 * This structure contains device information for test mode.
268 tapi_device_id_t device_id; /**< device id */
269 tapi_device_status_t device_status; /**< device status */
270 } tapi_device_info_t;
273 * This structure contains factory dft sms information.
276 TelFactoryDftSmsOption_t option; /**< factory dft sms option */
277 char number[SMS_NUM_SIZE]; /**< number */
278 char data[SMS_DATA_SIZE]; /**< data */
279 }TelFactoryDftSmsInfo_t;
282 tapi_factory_omission_avoidance_write_cmd_t write_cmd;
283 tapi_factory_omission_avoidance_read_cmd_t read_cmd;
284 } tapi_factory_omission_avoidance_cmd_t;
287 unsigned char test_id;
288 unsigned char test_result;
289 } tapi_factory_omission_avoidance_data_t;
292 tapi_factory_omission_avoidance_cmd_t cmd;
293 unsigned int data_cnt;
294 tapi_factory_omission_avoidance_data_t data[MAX_FACTORY_OMISSION_AVOIDANCE_DATA_CNT];
295 } tapi_factory_omission_avoidance_info_t;
299 * @brief This function is invoked to start service mode.
301 * @par Sync (or) Async:
302 * This is a Asynchronous API.
304 * @par Important Notes:
310 * @param [in] svc_mode, test_sub
311 * - svc_mode, test_sub. refer #tapi_service_mode_t, #tapi_test_mode_sub_t
313 * @par Async Response Message:
322 * @return Return Type (int) \n
323 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
324 * - Negative integer : it provides an error code (Refer #TapiResult_t)
326 * @par Prospective Clients:
330 TapiResult_t tel_start_svcmode(tapi_service_mode_t svc_mode, tapi_test_mode_sub_t test_sub);
334 * @brief This function is invoked to end service mode.
336 * @par Sync (or) Async:
337 * This is a Asynchronous API.
339 * @par Important Notes:
345 * @param [in] svc_mode
346 * - svc_mode. refer #tapi_service_mode_t
348 * @par Async Response Message:
357 * @return Return Type (int) \n
358 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
359 * - Negative integer : it provides an error code (Refer #TapiResult_t)
361 * @par Prospective Clients:
365 int tel_end_svcmode(tapi_service_mode_t svc_mode);
369 * @brief This function is invoked to process key code in service mode.
371 * @par Sync (or) Async:
372 * This is a Asynchronous API.
374 * @par Important Notes:
380 * @param [in] key_code
383 * @par Async Response Message:
392 * @return Return Type (int) \n
393 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
394 * - Negative integer : it provides an error code (Refer #TapiResult_t)
396 * @par Prospective Clients:
400 int tel_send_svcmode_keycode(char key_code);
404 * @brief This function is invoked to dump cp debug.
406 * @par Sync (or) Async:
407 * This is a Asynchronous API.
409 * @par Important Notes:
416 * - cp dump type. refer #tapi_service_mode_debug_cp_dump_t
418 * @par Async Response Message:
427 * @return Return Type (int) \n
428 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
429 * - Negative integer : it provides an error code (Refer #TapiResult_t)
431 * @par Prospective Clients:
435 int tel_request_svcmode_dump(tapi_service_mode_debug_cp_dump_t type);
438 * @brief This function is used to indicate start factory process to modem,
439 * Telephont will send Get operation to modem to get the items from Modem.
441 * @par Sync (or) Async:
442 * This is a Asynchronous function.
444 * @par Important Notes:
452 * @par Async Response Message:
461 * @return Return Type (int) \n
462 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
463 * - Negative integer : it provides an error code (Refer #TapiResult_t)
465 * @par Prospective Clients:
466 * External Apps.(Current, Launcher is)
469 int tel_start_imei_process(void);
472 * @brief This function is used to Indicate result for comparison item between PDA and Modem.
474 * @par Sync (or) Async:
475 * This is a Asynchronous function.
477 * @par Important Notes:
483 * @param nItemID, bResult
484 * - Index of ItemID and Result after comparison.
486 * @par Async Response Message:
495 * @return Return Type (int) \n
496 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
497 * - Negative integer : it provides an error code (Refer #TapiResult_t)
499 * @par Prospective Clients:
503 int tel_compare_imei_item(unsigned char nItemID, unsigned char bResult);
506 * @brief This function is used in factory process omission avoidance.
508 * @par Sync (or) Async:
509 * This is a Asynchronous function.
511 * @par Important Notes:
520 * @par Async Response Message:
529 * @return Return Type (int) \n
530 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
531 * - Negative integer : it provides an error code (Refer #TapiResult_t)
533 * @par Prospective Clients:
537 int tel_get_factory_omission_avoidance(tapi_factory_omission_avoidance_read_cmd_t cmd);
540 * @brief This function is used in factory process omission avoidance.
542 * @par Sync (or) Async:
543 * This is a Asynchronous function.
545 * @par Important Notes:
552 * - info : comman type, test id, test result
554 * @par Async Response Message:
563 * @return Return Type (int) \n
564 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
565 * - Negative integer : it provides an error code (Refer #TapiResult_t)
567 * @par Prospective Clients:
571 int tel_set_factory_omission_avoidance(tapi_factory_omission_avoidance_info_t *info);
577 #endif /*_ITAPI_SERVICE_MODE_H_*/