2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 using System.Collections.Generic;
22 /// A class which defines SIM card initialization information.
24 public class SimInitInfo
26 internal SimCardStatus SimStatus;
27 internal bool IsChanged;
28 internal SimInitInfo()
33 /// The SIM initialization status from the Telephony server boot up time.
35 public SimCardStatus Status
44 /// The SIM card identification value. It will be true when the current inserted SIM card differs from the previous SIM. False otherwise.
46 public bool IsCardChanged
56 /// A class which defines data for IMSI information.
58 public class SimImsiInfo
60 internal string CountryCode;
61 internal string NetworkCode;
62 internal string StationId;
63 internal SimImsiInfo()
68 /// Mobile Country Code.
79 /// Mobile Network Code.
90 /// Mobile Station Identification Number.
102 /// A class which defines data for ECC information of GSM/USIM/CDMA SIM.
104 public class SimEccInfo
106 internal string NameInfo;
107 internal string NumberInfo;
108 internal SimEccEmergencyServiceType TypeInfo;
109 internal SimEccInfo()
114 /// Name. Applicable only for USIM(3G) SIM.
136 /// Emergency service type. Applicable only for USIM(3G) SIM.
138 public SimEccEmergencyServiceType Category
148 /// A class which defines ECC information list.
150 public class SimEccInfoList
152 internal int EccCount;
153 internal IEnumerable<SimEccInfo> List;
154 internal SimEccInfoList()
172 public IEnumerable<SimEccInfo> EccList
182 /// A class which defines ICCID(Integrated Circuit Card Identifier).
184 public class SimIccIdInfo
187 internal string Number;
188 internal SimIccIdInfo()
193 /// Integrated Circuit Card number length.
204 /// Integrated Circuit Card number.
206 public string IccNumber
216 /// A class which defines call forwarding indication status data.
220 private int _recIndex;
221 private byte _mspNum;
222 private byte _cfuStatus;
223 private SimTypeOfNumber _ton;
224 private SimNumberPlanIdentity _npi;
225 private string _cfuNum;
227 private byte _ext7Id;
262 /// Call forwarding unconditional indication status.
264 public byte CfuStatus
278 /// SIM Type of number.
280 public SimTypeOfNumber Ton
294 /// SIM numbering plan identity.
296 public SimNumberPlanIdentity Npi
310 /// Dialing Number/SSC String.
326 /// Capability/Configuration 2 Record Identifier.
342 /// Extension 7 Record Identifier.
359 /// A class which defines call forwarding indication status list.
361 public class SimCfisList
364 internal IEnumerable<SimCfis> List;
365 internal SimCfisList()
372 public int ProfileCount
383 public IEnumerable<SimCfis> CfisList
393 /// A class which defines CPHS call forwarding status data.
395 public class SimCphsCf
403 /// CallForwardUnconditionalLine 1.
419 /// CallForwardUnconditionalLine 2.
435 /// CallForwardUnconditional Fax.
451 /// CallForwardUnconditional data.
468 /// A class which defines call forwarding response.
470 public class SimCallForwardResponse
472 internal bool IsCphsCf;
473 internal SimCfisList List;
474 internal SimCphsCf CphsCfInfo;
475 internal SimCallForwardResponse()
493 public SimCfisList CfList
504 public SimCphsCf CphsCf
514 /// A class which defines call forwarding request.
516 public class SimCallForwardRequest
518 private bool _isCphs;
519 private SimCfis _cfis;
520 private SimCphsCf _cphsCf;
542 /// This should be filled only if IsCphs is false.
561 /// This should be filled only if IsCphs is true.
563 public SimCphsCf CphsCf
578 /// A class which defines message waiting indication status data.
582 private int _recIndex;
583 private byte _indicatorStatus;
584 private int _voiceCount;
585 private int _faxCount;
586 private int _emailCount;
587 private int _otherCount;
588 private int _videoCount;
609 public byte IndicatorStatus
613 return _indicatorStatus;
618 _indicatorStatus = value;
625 public int VoiceCount
657 public int EmailCount
673 public int OtherCount
689 public int VideoCount
704 /// A class which defines message waiting indication status list.
706 public class SimMwisList
709 internal IEnumerable<SimMwis> List;
710 internal SimMwisList()
717 public int ProfileCount
728 public IEnumerable<SimMwis> MwList
738 /// A class which defines CPHS message waiting status data.
740 public class SimCphsMw
742 private bool _isVoice1;
743 private bool _isVoice2;
745 private bool _isData;
748 /// VoiceMsgLine1 message waiting flag.
764 /// VoiceMsgLine2 message waiting flag.
780 /// FAX message waiting flag.
796 /// Data message waiting flag.
813 /// A class which defines message waiting reponse.
815 public class SimMessageWaitingResponse
817 internal bool IsCphsMw;
818 internal SimMwisList List;
819 internal SimCphsMw CphsMwInfo;
820 internal SimMessageWaitingResponse()
838 public SimMwisList MwList
849 public SimCphsMw CphsMw
859 /// A class which defines message waiting request.
861 public class SimMessageWaitingRequest
863 private bool _isCphs;
864 private SimMwis _mwis;
865 private SimCphsMw _cphsMw;
887 /// This should be filled only if IsCphs is false.
906 /// This should be filled only if IsCphs is true.
908 public SimCphsMw CphsMw
923 /// A class which defines mailbox dialing number data.
925 public class SimMailboxNumber
927 private bool _isCphs;
928 private int _recIndex;
929 private int _profileNumber;
930 private SimMailboxType _mbType;
931 private int _alphaMaxLength;
932 private string _alphaId;
933 private SimTypeOfNumber _ton;
934 private SimNumberPlanIdentity _npi;
935 private string _number;
937 private byte _ext1Id;
956 /// Index which stands for the location where the record is saved in SIM.
972 /// SIM profile index.
974 public int ProfileNumber
978 return _profileNumber;
983 _profileNumber = value;
990 public SimMailboxType MbType
1004 /// Alpha max length in SIM.
1006 public int AlphaMaxLength
1010 return _alphaMaxLength;
1015 _alphaMaxLength = value;
1020 /// Alpha Identifier.
1022 public string AlphaId
1038 public SimTypeOfNumber Ton
1052 /// Number Plan Identity.
1054 public SimNumberPlanIdentity Npi
1068 /// Dialing Number/SSC String.
1070 public string Number
1084 /// Capability/Configuration Identifier.
1100 /// Extension 1 Record Identifier.
1117 /// A class which defines mailbox dialing number list.
1119 public class SimMailboxList
1121 internal int MbCount;
1122 internal IEnumerable<SimMailboxNumber> MbList;
1123 internal SimMailboxList()
1139 /// List of mailbox.
1141 public IEnumerable<SimMailboxNumber> List
1151 /// A class which defines available optional CPHS SIM files.
1153 public class SimCphsServiceTable
1155 internal int CustomerSvcProfile;
1156 internal int SvcStringTable;
1157 internal int MbNumbers;
1158 internal int OperatorNameShort;
1159 internal int InformationNum;
1160 internal SimCphsServiceTable()
1165 /// Customer Service Profile (CSP).
1167 public int CustomerServiceProfile
1171 return CustomerSvcProfile;
1176 /// Service String Table (SST).
1178 public int ServiceStringTable
1182 return SvcStringTable;
1189 public int MailboxNumbers
1198 /// Short form of operator name.
1200 public int OperatorNameShortForm
1204 return OperatorNameShort;
1209 /// Information numbers.
1211 public int InformationNumbers
1215 return InformationNum;
1221 /// A class which defines CPHS information data.
1223 public class SimCphsInfo
1225 internal SimCphsPhaseType Phase;
1226 internal SimCphsServiceTable CphsSvcTable;
1227 internal SimCphsInfo()
1232 /// CPHS phase type.
1234 public SimCphsPhaseType CphsPhase
1243 /// CPHS service table.
1245 public SimCphsServiceTable CphsServiceTable
1249 return CphsSvcTable;
1255 /// A class which defines CSIM service table.
1259 internal SimCdmaServiceTable CdmaSvc;
1260 internal byte[] Cdma;
1261 internal byte[] Csim;
1267 /// Cdma service table;
1269 public SimCdmaServiceTable CdmaSvcTable
1278 /// Cdma service. Gives mask value of SimCdmaService enum.
1281 /// This will be filled only if CdmaSvcTable is Cdma.
1283 public byte[] CdmaService
1292 /// Csim service. Gives mask value of SimCsimService enum.
1295 /// This will be filled only if CdmaSvcTable is Csim.
1297 public byte[] CsimService
1307 /// A class which defines SIM service table.
1309 public class SimServiceTable
1311 internal SimCardType Type;
1312 internal byte[] Sst;
1313 internal byte[] Ust;
1314 internal SimCst Cst;
1315 internal SimServiceTable()
1322 public SimCardType SimType
1331 /// SIM service table. Gives mask value of SimSstService enum.
1334 /// This will be filled only if SimType is Gsm.
1336 public byte[] SstService
1345 /// USIM service table. Gives mask value of SimUstService enum.
1348 /// This will be filled only if SimType is Usim.
1350 public byte[] UstService
1359 /// CSIM service table.
1362 /// This will be filled only if SimType is Ruim.
1364 public SimCst CstService
1374 /// A class which defines MSISDN information of the GSM/CDMA SIM.
1376 public class SimSubscriberInfo
1378 internal string MsisdnNum;
1379 internal string MsisdnName;
1380 internal SimSubscriberInfo()
1385 /// MSISDN number. If it does not exist, a null string will be returned
1387 public string Number
1396 /// MSISDN name. If it does not exist, a null string will be returned. Not applicable for CDMA.
1408 /// A class which defines MSISDN list.
1410 public class SimMsisdnList
1412 internal int MsisdnCount;
1413 internal IEnumerable<SimSubscriberInfo> SubscriberList;
1414 internal SimMsisdnList()
1430 /// List of subscriber info.
1432 public IEnumerable<SimSubscriberInfo> List
1436 return SubscriberList;
1442 /// A class which defines OPLMNwACT data.
1444 public class SimOplmnwact
1446 internal string PlmnString;
1447 internal bool UmtsFlag;
1448 internal bool GsmFlag;
1449 internal SimOplmnwact()
1488 /// A class which defines OPLMNwACT list.
1490 public class SimOplmnwactList
1492 internal int OplmnCount;
1493 internal IEnumerable<SimOplmnwact> OplmnList;
1494 internal SimOplmnwactList()
1510 /// List of OPLMNWACT.
1512 public IEnumerable<SimOplmnwact> List
1522 /// A class which defines SPN(Service Provider Name).
1526 internal byte Condition;
1527 internal string SpName;
1533 /// Display condition.
1535 public byte DisplayCondition
1544 /// Service Provider Name.
1556 /// A class which defines CPHS network name.
1558 public class SimCphsNetName
1560 internal string Full;
1561 internal string Short;
1562 internal SimCphsNetName()
1569 public string FullName
1580 public string ShortName
1590 /// A class which defines authentication request data.
1592 public class SimAuthenticationData
1594 private SimAuthenticationType _authType;
1595 private int _randLength;
1596 private int _autnLength;
1597 private byte[] _randData;
1598 private byte[] _autnData;
1599 private SimAuthenticationData()
1604 /// A constructor to instantiate SimAuthenticationData class with necessary parameters.
1606 /// <param name="authType">Authentication type.</param>
1607 /// <param name="randLength">The length of RAND.</param>
1608 /// <param name="autnLength">The length of AUTN. It is not used in case of GSM AUTH.</param>
1609 /// <param name="randData">RAND data.</param>
1610 /// <param name="autnData">AUTN data. It is not used in case of GSM AUTH.</param>
1611 public SimAuthenticationData(SimAuthenticationType authType, int randLength, int autnLength, byte[] randData, byte[] autnData)
1613 _authType = authType;
1614 _randLength = randLength;
1615 _autnLength = autnLength;
1616 _randData = randData;
1617 _autnData = autnData;
1620 internal SimAuthenticationType AuthType
1628 internal int RandLength
1636 internal int AutnLength
1644 internal byte[] RandData
1652 internal byte[] AutnData
1662 /// A class which defines authentication result data.
1664 public class SimAuthenticationResponse
1666 internal SimAuthenticationType Type;
1667 internal SimAuthenticationResult Result;
1668 internal int RespLength;
1669 internal string RespData;
1670 internal int AuthKeyLen;
1671 internal string Key;
1672 internal int CipherLen;
1673 internal string Cipher;
1674 internal int IntegrityLen;
1675 internal string Integrity;
1676 internal SimAuthenticationResponse()
1681 /// Authentication type.
1683 public SimAuthenticationType AuthType
1692 /// Authentication result.
1694 public SimAuthenticationResult AuthResult
1703 /// Response length.
1705 public int ResponseLength
1716 public string ResponseData
1725 /// The length of the authentication key.
1727 public int AuthKeyLength
1736 /// The data of the authentication key.
1738 public string AuthKey
1747 /// The length of the cipher key.
1749 public int CipherLength
1760 public string CipherData
1769 /// The length of the integrity key.
1771 public int IntegrityLength
1775 return IntegrityLen;
1782 public string IntegrityData
1792 /// A class which defines information about SIM PIN data.
1794 public class SimPinData
1796 private SimPinType _type;
1797 private string _pin;
1798 private uint _pinLength;
1799 private SimPinData()
1804 /// A constructor to instantiate SimPinData class which necessary parameters.
1806 /// <param name="type">PIN type.</param>
1807 /// <param name="pin">PIN code.</param>
1808 /// <param name="pinLength">PIN code length.</param>
1809 public SimPinData(SimPinType type, string pin, uint pinLength)
1813 _pinLength = pinLength;
1816 internal SimPinType Type
1832 internal uint PinLength
1842 /// A class which defines PIN information.
1844 public class SimPinResult
1846 internal SimPinType PinType;
1848 internal SimPinResult()
1853 /// Specifies the PIN or PUK type.
1855 public SimPinType Type
1864 /// Number of attempts remaining for PIN/PUK verification.
1866 public int RetryCount
1876 /// A class which is used to used to enable/disable facility.
1878 public class SimFacility
1880 private SimLockType _lockType;
1881 private string _password;
1882 private int _passwordLength;
1883 private SimFacility()
1888 /// A constructor to instantiate SimFacility class with necessary parameters.
1890 /// <param name="lockType">Facility type.</param>
1891 /// <param name="password">Password.</param>
1892 /// <param name="passwordLength">Password length.</param>
1893 public SimFacility(SimLockType lockType, string password, int passwordLength)
1895 _lockType = lockType;
1896 _password = password;
1897 _passwordLength = passwordLength;
1900 internal SimLockType LockType
1908 internal string Password
1916 internal int PasswordLength
1920 return _passwordLength;
1926 /// A class which defines facility result data.
1928 public class SimFacilityResult
1930 internal SimLockType LockType;
1932 internal SimFacilityResult()
1937 /// Specifies the PIN or PUK type.
1939 public SimLockType Type
1948 /// Number of attempts remaining for PIN/PUK verification.
1950 public int RetryCount
1960 /// A class which defines facility info data.
1962 public class SimFacilityInfo
1964 internal SimLockType LockType;
1965 internal SimFacilityStatus FacilityStatus;
1966 internal SimFacilityInfo()
1973 public SimLockType Type
1982 /// Facility status.
1984 public SimFacilityStatus Status
1988 return FacilityStatus;
1994 /// A class which defines information about lock type.
1996 public class SimLockInfo
1998 internal SimLockType LockType;
1999 internal SimLockStatus LockStatus;
2001 internal SimLockInfo()
2008 public SimLockType Type
2019 public SimLockStatus Status
2030 public int RetryCount
2040 /// A class which defines APDU information.
2042 public class SimApdu
2044 private byte[] _apdu;
2050 /// A constructor to instantiate SimApdu class with necessary parameters.
2052 /// <param name="apdu">APDU.</param>
2053 public SimApdu(byte[] apdu)
2058 internal byte[] Apdu
2068 /// A class which defines the response of sending APDU.
2070 public class SimApduResponse
2072 internal ushort ApduLen;
2073 internal byte[] ApduResp;
2074 internal SimApduResponse()
2079 /// Length of response APDU.
2081 public ushort ApduLength
2092 public byte[] ApduResponse
2102 /// A class which defines the response of sending ATR.
2104 public class SimAtrResponse
2106 internal ushort AtrRespLen;
2107 internal byte[] AtrResp;
2108 internal SimAtrResponse()
2113 /// Length of response ATR.
2115 public ushort AtrRespLength
2126 public byte[] AtrResponse
2136 /// A class which defines ISIM IMPU list data.
2138 public class SimImpuList
2140 internal uint DataCount;
2141 internal IEnumerable<string> ImpuList;
2142 internal SimImpuList()
2147 /// ISIM IMPU data count.
2160 public IEnumerable<string> List
2170 /// A class which defines ISIM P-CSCF data.
2172 public class SimPcscf
2174 internal SimPcscfType PcscfType;
2175 internal string PcscfData;
2181 /// ISIM P-CSCF type.
2183 public SimPcscfType Type
2192 /// ISIM P-CSCF data.
2204 /// A class which defines ISIM P-CSCF list data.
2206 public class SimPcscfList
2208 internal uint DataCount;
2209 internal IEnumerable<SimPcscf> PcscfList;
2210 internal SimPcscfList()
2215 /// ISIM P-CSCF data count.
2226 /// ISIM P-CSCF list.
2228 public IEnumerable<SimPcscf> List