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 Network_TAPI Network
29 @brief This file serves as a "C" header file and defines structures for Tapi Network Services\n
30 It contains a sample set of constants, enums, structs that would be required by applications.
33 #ifndef _TEL_NETWORK_H_
34 #define _TEL_NETWORK_H_
41 #define TAPI_NETWORK_ORDER_MAX 5 /**< Maximum network order */
42 #define TAPI_NETWORK_LIST_MAX 15 /**< Maximum network list */
43 #define TAPI_NETWORK_PLMN_LEN_MAX 6 /**< Maximum PLMN length*/
44 #define TAPI_NETWORK_NAME_LEN_MAX 40 /**< Maximum network name or PLMN name length*/
45 #define TAPI_NETWORK_SPN_LEN_MAX 20 /**< Maximum network service provider name length */
46 #define TAPI_PREFERRED_PLMN_RECORDS_MAX 150 /**< Maximum record length for preferred plmn list*/
47 #define TAPI_NETWORK_DISPLAY_INFO_ELEMENTS 4 /**< Maximum network Display info element length */
48 #define TAPI_NETWORK_HOMEZONE_TAG_MAX_LEN 13 /**< Maximum Network Home zone tag length */
49 #define TAPI_NETWORK_CS_DISP_INDEX 0 /**< Maximum Network CS display index length */
50 #define TAPI_NETWORK_PS_DISP_INDEX 1 /**< Maximum Network PS display index length */
51 #define TAPI_NETWORK_SVC_DISP_INDEX 2 /**< Maximum Network SVC display index length */
52 #define TAPI_NETWORK_ROAM_DISP_INDEX 3 /**< Maximum Network roaming display index length */
53 #define TAPI_NETWORK_SUBS_SVC_NUM_MAX 6 /**< Maximum number of the Subscriber's services */
54 #define TAPI_NETWORK_SUBS_NUM_LEN_MAX 40 /**< Maximum Subscriber Number Length */
55 #define TAPI_NETWORK_SUBS_ALPHA_LEN_MAX 16 /**< Maximum Subscriber Name Length */
56 #define TAPI_NETWORK_GERAN_NEIGHBORING_CELL_LIST_MAX 6 /**< Maximum GERAN neighboring cell list */
57 #define TAPI_NETWORK_UMTS_NEIGHBORING_CELL_LIST_MAX 24 /**< Maximum UMTS neighboring cell list */
59 /* This value defines the network mode */
60 #define TAPI_NETWORK_MODE_AUTO 0x00 /**< Set Network mode to AUTOMATIC */
61 #define TAPI_NETWORK_MODE_GSM 0x01 /**< Set Network mode to GSM */
62 #define TAPI_NETWORK_MODE_WCDMA 0x02 /**< Set Network mode to WCDMA */
63 #define TAPI_NETWORK_MODE_CDMA 0x04 /**< Set Network mode to CDMA */
64 #define TAPI_NETWORK_MODE_LTE 0x08 /**< Set Network mode to LTE */
67 * @enum TelNetworkSelectionMode_t
68 * This enumeration defines the network selection modes.
71 TAPI_NETWORK_SELECTIONMODE_AUTOMATIC, /**< Network selection is in Automatic selection mode*/
72 TAPI_NETWORK_SELECTIONMODE_MANUAL /**< Network selection is in Manual selection mode */
73 } TelNetworkSelectionMode_t;
76 * @enum TelNetworkServiceDomain_t
77 * This enumeration defines the network service domains .
80 TAPI_NETWORK_SERVICE_DOMAIN_COMBINED, /**< This member sets the Circuit switch and Packet Switch domain */
81 TAPI_NETWORK_SERVICE_DOMAIN_PS, /**< This member sets the Packet Switch service domain */
82 TAPI_NETWORK_SERVICE_DOMAIN_CS, /**< This member sets the Circuit Switch service domain */
83 TAPI_NETWORK_SERVICE_DOMAIN_AUTOMATIC /**< This member sets the service domain to Circuit Switch and Packet Switch or Circuit Switch or Packet Switch domain */
84 } TelNetworkServiceDomain_t;
87 * @enum TelNetworkServiceLevel_t
88 * This enumeration defines the status of network service.
91 TAPI_NETWORK_SERVICE_LEVEL_NO, /**< No service available in the network ME is camped */
92 TAPI_NETWORK_SERVICE_LEVEL_EMERGENCY, /**< Only emergency service available in the network ME is camped */
93 TAPI_NETWORK_SERVICE_LEVEL_FULL, /**< FULL service available in the network ME is camped */
94 TAPI_NETWORK_SERVICE_LEVEL_SEARCH /**< Searching for service */
95 } TelNetworkServiceLevel_t;
98 * @enum TelNetworkServiceLevel_t
99 * This enumeration defines the service types of TAPI.
102 TAPI_NETWORK_SERVICE_TYPE_UNKNOWN = 0x0, /**< Service type is Unknown */
103 TAPI_NETWORK_SERVICE_TYPE_NO_SERVICE, /**< No Service available */
104 TAPI_NETWORK_SERVICE_TYPE_EMERGENCY, /**< Service type is Emergency */
105 TAPI_NETWORK_SERVICE_TYPE_SEARCH, /**< Service type is Serching */
106 TAPI_NETWORK_SERVICE_TYPE_2G, /**< Service type is 2G */
107 TAPI_NETWORK_SERVICE_TYPE_2_5G, /**< Service type is 2.5G */
108 TAPI_NETWORK_SERVICE_TYPE_2_5G_EDGE, /**< Service type is 2.5G (EDGE) */
109 TAPI_NETWORK_SERVICE_TYPE_3G, /**< Service type is 3G */
110 TAPI_NETWORK_SERVICE_TYPE_HSDPA, /**< Service type is HSDPA */
111 TAPI_NETWORK_SERVICE_TYPE_LTE /**< Service type is LTE */
112 } TelNetworkServiceType_t;
115 * @enum TelNetworkSystemType_t
116 * This enumeration defines the system types of TAPI.
120 TAPI_NETWORK_SYSTEM_NO_SRV, /**< No Service available */
121 TAPI_NETWORK_SYSTEM_GSM, /**< Available service is GSM */
122 TAPI_NETWORK_SYSTEM_GPRS, /**< Available service is GPRS */
123 TAPI_NETWORK_SYSTEM_EGPRS, /**< Available service is EGPRS */
124 TAPI_NETWORK_SYSTEM_PCS1900, /**< Available service is PCS1900 band */
125 TAPI_NETWORK_SYSTEM_UMTS, /**< Available service is UMTS */
126 TAPI_NETWORK_SYSTEM_GSM_AND_UMTS, /**< Both GSM and UMTS systems available */
127 TAPI_NETWORK_SYSTEM_HSDPA, /**< Available service is hsdpa */
128 TAPI_NETWORK_SYSTEM_IS95A, /**< Available service is IS95A */
129 TAPI_NETWORK_SYSTEM_IS95B, /**< Available service is IS95B */
130 TAPI_NETWORK_SYSTEM_CDMA_1X, /**< Available service is CDMA 1X */
131 TAPI_NETWORK_SYSTEM_EVDO_REV_0, /**< Available service is EV-DO rev0 */
132 TAPI_NETWORK_SYSTEM_1X_EVDO_REV_0_HYBRID, /**< Available service is 1X and EV-DO rev0 */
133 TAPI_NETWORK_SYSTEM_EVDO_REV_A, /**< Available service is EV-DO revA */
134 TAPI_NETWORK_SYSTEM_1X_EVDO_REV_A_HYBRID, /**< Available service is 1X and EV-DO revA */
135 TAPI_NETWORK_SYSTEM_EVDV, /**< Available service is EV-DV */
136 TAPI_NETWORK_SYSTEM_LTE /**< Available service is LTE */
137 } TelNetworkSystemType_t;
140 * @enum TelNetworkBandPreferred_t
141 * This enumeration defines the operations that can be done on network Band.
145 TAPI_NETWORK_BAND_MODE_PREFERRED = 0x01, /**< Preferred band. (If preferred Band is not available, then underlying modem can search on other bands) */
146 TAPI_NETWORK_BAND_MODE_ONLY = 0x02, /**< This allows only particular band. */
147 } TelNetworkBandPreferred_t;
150 * @enum TelNetworkBand_t
151 * This enumeration defines different network Bands.
155 TAPI_NETWORK_BAND_TYPE_ANY = 0x00, /**< All bands can be tried. */
156 TAPI_NETWORK_BAND_TYPE_GSM850, /**< This member sets the band to GSM 850 */
157 TAPI_NETWORK_BAND_TYPE_GSM_900_1800, /**< This member sets the band to GSM 900_1800 */
158 TAPI_NETWORK_BAND_TYPE_GSM1900, /**< GSM 1900*/
159 TAPI_NETWORK_BAND_TYPE_GSM, /**< This member sets all GSM bands */
160 TAPI_NETWORK_BAND_TYPE_WCDMA, /**< This member sets all WCDMA bands */
161 TAPI_NETWORK_BAND_TYPE_WCDMA850, /**< This member sets the band to WCDMA 850 */
162 TAPI_NETWORK_BAND_TYPE_WCDMA1900, /**< This member sets the band to WCDMA 1900 */
163 TAPI_NETWORK_BAND_TYPE_WCDMA2100, /**< This member sets the band to WCDMA 2100 */
164 TAPI_NETWORK_BAND_TYPE_GSM900, /**< GSM 900*/
165 TAPI_NETWORK_BAND_TYPE_GSM1800, /**< This member sets the band to GSM 1800 */
166 TAPI_NETWORK_BAND_TYPE_GSM_850_1900, /**< This member sets the band to GSM 850_1900 */
167 TAPI_NETWORK_BAND_TYPE_LTE_BAND_4, /**< This member sets the band to LTE BAND 4*/
168 TAPI_NETWORK_BAND_TYPE_LTE_BAND_17 /**< This member sets the band to LTE BAND 17 */
172 * @enum TelNetworkOperationCause_t
173 * This enumeration defines different network operation cause.
177 TAPI_NETWORK_NO_ERR = 0x00, /**< There is no error for any network operation. */
178 TAPI_NETWORK_OPERATION_ABORTED, /**< This error is sent when operation is aborted */
179 TAPI_NETWORK_OPERATION_FAILED, /**< There is an error for any network operation. */
180 TAPI_NETWORK_PHONE_IN_USE_ERR, /**< This error will be returned when any network operation is tried while phone is in use(eg, Voice / Data call in progress due to which network operation failed) */
181 TAPI_NETWORK_OFFLINE_ERR, /**< This error is sent when any network option is tried when phone is in offline mode */
182 TAPI_NETWORK_CONFIG_SETTINGS_FAILURE_ERR, /**< This error is sent when modem is unable to process the config settings information. */
183 TAPI_NETWORK_INTERNAL_FAILURE_ERR, /**< This error to indicate internal failure */
184 TAPI_NETWORK_MEMORY_FULL_ERR /**< This error is caused by memory full */
185 } TelNetworkOperationCause_t;
189 * @enum TelNetworkPreferredPlmnOp_t
190 * This enumeration defines the operation that can be done on preferred PLMN.
194 TAPI_NETWORK_PREF_PLMN_ADD=0x01, /**< Addition to Network Preferred Plmn list*/
195 TAPI_NETWORK_PREF_PLMN_EDIT, /**< Edit the network Preferred Plmn list */
196 TAPI_NETWORK_PREF_PLMN_DELETE /**< Delete the entry to network Preferred Plmn list*/
197 } TelNetworkPreferredPlmnOp_t;
200 * @enum TelNetworkPlmnType_t
201 * This structure defines Network Plmn type.
205 TAPI_UNKNOWN_PLMN=0, /**< Network Plmn type Unknown */
206 TAPI_HOME_PLMN , /**< Network Plmn type Home Plmn */
207 TAPI_AVAILABLE_PLMN, /**< Network Plmn Available */
208 TAPI_FORBIDDEN_PLMN, /**< Network Plmn Forbidden */
209 }TelNetworkPlmnType_t;
212 * @enum TelNetworkHomeZoneCommand_t
213 * This enumeration defines network home zone command.
217 TAPI_NETWORK_ZONEINFO_NONE, /**< Network Zone info none */
218 TAPI_NETWORK_ZONEINFO_IND, /**< Network Zone info indication */
219 TAPI_NETWORK_ZONEINFO_CLEAR /**< Network Zone info clear */
220 }TelNetworkHomeZoneCommand_t;
223 * @enum TelNetworkHomeZone_t
224 * This enumeration defines network home zone type.
228 TAPI_NETWORK_ZONE_NONE, /**< Network Zone Type none */
229 TAPI_NETWORK_ZONETYPE_HOMEZONE, /**< Network Zone Type Home zone */
230 TAPI_NETWORK_ZONETYPE_CITYZONE, /**< Network Zone Type City zone */
231 }TelNetworkHomeZone_t;
234 * @enum TelNetworkNameDispCondition_t
235 * This enumeration defines network name display condition type.
239 TAPI_NETWORK_DISP_INVALID= 0x00, /**< Invalid Display Condition */
240 TAPI_NETWORK_DISP_SPN = 0x01, /**< Display Condition is SPN */
241 TAPI_NETWORK_DISP_PLMN = 0x02, /**< Display Condition is PLMN */
242 TAPI_NETWORK_DISP_SPN_PLMN = 0x03, /**< Display Condition is SPN or PLMN */
243 }TelNetworkNameDispCondition_t;
246 * @enum TelNetworkPrefNetType_t
247 * This enumeration defines CDMA Preferred Network Type(CDMA only).
251 TAPI_NETWORK_PREF_NET_TYPE_AUTOMATIC = 0x01, /**< 0x01 : AUTOMATIC */
252 TAPI_NETWORK_PREF_NET_TYPE_AUTOMATIC_A, /**< 0x02 : AUTOMATIC A */
253 TAPI_NETWORK_PREF_NET_TYPE_AUTOMATIC_B, /**< 0x03 : AUTOMATIC B */
254 TAPI_NETWORK_PREF_NET_TYPE_HOME_ONLY, /**< 0x04 : HOME ONLY */
255 TAPI_NETWORK_PREF_NET_TYPE_ROAM_ONLY, /**< 0x05 : ROAM ONLY */
256 } TelNetworkPrefNetType_t;
259 * @enum TelNetworkPrlPrefOnly_t
260 * This enumeration defines CDMA PRL Preferred Only field stored in the PRL(CDMA only).
264 TAPI_NETWORK_PRL_PREF_ONLY_OFF, /**< Preferred Only is FALSE */
265 TAPI_NETWORK_PRL_PREF_ONLY_ON, /**< Preferred Only is TRUE */
266 TAPI_NETWORK_PRL_PREF_ONLY_NONE /**< There isn't Preferred Only Option */
267 } TelNetworkPrlPrefOnly_t;
271 * This structure defines the preferred plmn information.
274 unsigned char Index; /**< Network Preferred Plmn list index */
275 char Plmn[TAPI_NETWORK_PLMN_LEN_MAX + 1]; /**< Network Preferred Plmn */
276 char network_name[TAPI_NETWORK_NAME_LEN_MAX + 1]; /**< Network Name */
277 char service_provider_name[TAPI_NETWORK_NAME_LEN_MAX + 1]; /**< Service provider name */
278 TelNetworkSystemType_t SystemType; /**< Network system type */
279 } TelNetworkPreferredPlmnInfo_t;
283 * This structure defines the preferred plmn list.
286 unsigned int NumOfPrefPlmns; /**< Number of preferred plmns in the list */
287 TelNetworkPreferredPlmnInfo_t PrefPlmnRecord[TAPI_PREFERRED_PLMN_RECORDS_MAX]; /**< preferred plmns list */
288 } TelNetworkPreferredPlmnList_t;
292 * This structure defines the location area code and cell id.
295 unsigned short LocationAreaCode; /**< Network Location area code */
296 unsigned long CellId; /**< Network Cell Id */
297 } TelNetworkLocationCellInfo_t;
301 * This structure defines the network status .
304 unsigned char svctype; /**< Network svc type */
305 unsigned char roaming; /**< Network roaming */
306 } TelNetworkStatus_t;
310 * This structure defines the network Cs,Ps status.
313 unsigned char cstype; /**< Network Cs type */
314 unsigned char pstype; /**< Network Ps type */
315 } TelNetworkCsPsStatus_t;
318 * TelNetworkIdentity_t
319 * This structure defines the network identity.
322 char network_name[TAPI_NETWORK_NAME_LEN_MAX + 1]; /**< Network Name */
323 char service_provider_name[TAPI_NETWORK_NAME_LEN_MAX + 1]; /**< Service provider name */
324 char plmn[TAPI_NETWORK_PLMN_LEN_MAX+1]; /**< Network PLMN */
325 unsigned int plmn_id; /**< PLMN ID */
326 TelNetworkPlmnType_t type_of_plmn; /**< PLMN type */
327 TelNetworkSystemType_t access_technology; /**< Access technology */
328 } TelNetworkIdentity_t;
332 * This structure defines the network Plmn list.
335 char networks_count; /**< Network Plmn count */
336 TelNetworkIdentity_t network_list[TAPI_NETWORK_LIST_MAX]; /**< Network list */
337 } TelNetworkPlmnList_t;
341 * This structure defines the network display info.
344 int DisplayInfo[TAPI_NETWORK_DISPLAY_INFO_ELEMENTS]; /**< Network display info */
345 } TelNetworkDisplayInfo_t;
348 TelNetworkNameDispCondition_t DispCondition; /**< Display condition of SPN & PLMN */
349 unsigned char Spn[TAPI_NETWORK_SPN_LEN_MAX + 1]; /**< Spn value */
350 unsigned char Plmn[TAPI_NETWORK_NAME_LEN_MAX + 1]; /**< PLMN value, In 2G case if DispPlmn is true and the PLMN value is null then Network module has to display registered PLMN */
351 } TelNetworkSpnPlmnDisplayInfo_t;
354 * * @struct TelNetworkSpnMccMncInfo_t
355 * This structure defines the network Spn, Mcc and Mnc info.
358 int mcc; /**< Network mcc */
359 int mnc; /**< Network Mnc */
360 char bDispCondition; /**<Display condition */
361 char short_network_name[TAPI_NETWORK_NAME_LEN_MAX + 1]; /**< Network short Name */
362 char spn_name[TAPI_NETWORK_NAME_LEN_MAX + 1]; /**< Network spn Name */
363 } TelNetworkSpnMccMncInfo_t;
367 TelNetworkSystemType_t act; /**< Access technology */
368 char plmn[TAPI_NETWORK_PLMN_LEN_MAX+1]; /**< Network PLMN */
369 int lac; /**< Location Area Code */
370 } TelNetworkServing_t;
373 int cell_id; /**< Cell ID (-1 indicates cell ID information not present) */
374 int lac; /**< Location area code (this field is ignored when cell_id not present) */
375 int bcch; /**< Broadcast Control Channel Frequency number */
376 int bsic; /**< Base Station Identification Code */
377 int rxlev; /**< Received Signal Strength level. Valid values are (0-63, 99)
378 * Reference: 33GPP TS 45.008 [20] subclause 8.1.4
379 - Rxlev 0 is a signal strength less than -110 dBm
380 - Rxlev 1 is -110 dBm to -109 dBm
381 - Rxlev 2 is -109 dBm to -108 dBm
383 - Rxlev 62 is -49 dBm to -48 dBm
384 - Rxlev 63 is greater than -48 dBm
385 - Rxlev 99 is not known or not detectable
387 } TelNetworkGeranCellInfo_t;
390 int cell_id; /**< UCID (-1 indicates cell ID information not present) */
391 /* UCID : RNCID + Cell ID(16 bit) */
392 int lac; /* Location area code (this field is ignored when cell_id not present) */
393 int arfcn; /**< UTRA Absolute RF Channel Number */
394 int psc; /**< Primary scrambling Code */
395 int rscp; /**< Received Signal Code Power. Valid values are (0-96, 255)
396 * Reference : 3GPP TS 25.133 [95] subclause 9.1.1.3 and 3GPP TS 25.123 [96] subclause 9.1.1.1.3)
397 - Rscp 0 is a signal strength less than -120 dBm
398 - Rscp 1 is -120 dBm to -119 dBm
399 - Rscp 2 is -119 dBm to -118 dBm
401 - Rscp 95 is -26 dBm to -25 dBm
402 - Rscp 96 is greater than -25 dBm
403 - Rscp 255 is not known or not detectable
405 } TelNetworkUmtsCellInfo_t;
408 int cell_id; /**< Cell ID (-1 indicates cell ID information not present) */
409 int lac; /**< Location area code (this field is ignored when cell_id not present) */
410 int earfcn; /**< E-UTRA Absolute RF Channel Number */
411 int tac; /**< Tracking area code */
412 int rssi; /**< RSSI in dBm (signed) */
413 } TelNetworkLteCellInfo_t;
416 TelNetworkSystemType_t act; /**< Access technology */
417 int mcc; /**< Mobile Country Code */
418 int mnc; /**< Mobile Network Code */
420 TelNetworkGeranCellInfo_t geran; /**< GERAN cell info */
421 TelNetworkUmtsCellInfo_t umts; /**< UMTS cell info */
422 TelNetworkLteCellInfo_t lte; /**< LTE cell info */
424 } TelNetworkServingCellInfo_t;
427 TelNetworkServingCellInfo_t serving; /**< Serving cell info */
428 int geran_list_count;/**< GERAN cell info list count */
429 TelNetworkGeranCellInfo_t geran_list[TAPI_NETWORK_GERAN_NEIGHBORING_CELL_LIST_MAX];/**< GERAN cell info list */
430 int umts_list_count;/**< UMTS cell info list count */
431 TelNetworkUmtsCellInfo_t umts_list[TAPI_NETWORK_UMTS_NEIGHBORING_CELL_LIST_MAX];/**< UMTS cell info list */
432 } TelNetworkNeighboringCellInfo_t;
438 struct tel_noti_network_registration_status {
439 int cs; /**< Circuit Switched status */
440 int ps; /**< Packet Swithced status */
441 int type; /**< Registration service type */
442 int is_roaming; /**< Roaming status */
445 struct tel_noti_network_signal_strength {
446 int dbm; /**< Signal Strenght in dbm */
449 struct tel_noti_network_cell_info {
450 int lac; /**< Location Area Code */
451 int cell_id; /**< Cell ID */
454 struct tel_noti_network_change {
455 TelNetworkSystemType_t act; /**< Access technology */
456 char plmn[TAPI_NETWORK_PLMN_LEN_MAX+1]; /**< Network PLMN */
457 int lac; /**< Location Area Code */
460 struct tel_noti_network_time_info {
471 char plmn[TAPI_NETWORK_PLMN_LEN_MAX+1]; /**< Network PLMN */
474 struct tel_noti_network_identity {
475 char plmn[TAPI_NETWORK_PLMN_LEN_MAX+1]; /**< Network PLMN */
476 char short_name[17]; /**< Short network name */
477 char full_name[33]; /**< Full network name */
480 struct tel_noti_network_neighboring_cell_info {
481 TelNetworkNeighboringCellInfo_t info; /**< Neighboring Cell Information */
488 #endif // _TEL_NETWORK_H_