public InternetServiceProfile(int ServiceProfileID, InternetServiceType type, InternetConnectionProfile profile) { this.pDelFlag = POPDeleteFlage.unknown; this.alphabet = Alphabet.unknown; this.pCmd = POPCommand.unknown; this.profileID = ServiceProfileID; this.srvType = type; this.conId = profile.profileID; user = passwd = tcpPort = address = hcContent = hcContLen = hcUsrAgent = hcProp = hcRedir = hcAuth = smFrom = smRcpt = smCC = smSubj = smHdr = smAuth = pNumber = pLength = tcpMR = tcpOT = secOpt = ""; }
public void Internet_Setup_Connection_Profile(InternetConnectionProfile profile) { SendATCommand("AT^SICS=" + profile.profileID + ",conType," + InternetConnectionProfile.GetInternetConnectionString(profile.conType)); SendATCommand("AT^SICS=" + profile.profileID + ",apn," + profile.apn); if (profile.user.Length > 0) SendATCommand("AT^SICS=" + profile.profileID + ",user," + profile.user); if (profile.passwd.Length > 0) SendATCommand("AT^SICS=" + profile.profileID + ",passwd," + profile.passwd); if (profile.inactTO.Length > 0) SendATCommand("AT^SICS=" + profile.profileID + ",inactTO," + profile.inactTO); if (profile.dns1.Length > 0) SendATCommand("AT^SICS=" + profile.profileID + ",dns1," + profile.dns1); if (profile.dns2.Length > 0) SendATCommand("AT^SICS=" + profile.profileID + ",dns2," + profile.dns2); if (profile.alphabet.Length > 0) SendATCommand("AT^SICS=" + profile.profileID + ",alphabet," + profile.alphabet); }
public InternetConnectionProfile Internet_Read_Connection_Profile(int ProfileID) { GeneralResponse re = SendATCommand("AT^SICS?"); if (re.IsSuccess && re.PayLoad.Length > 0) { InternetConnectionProfile p = new InternetConnectionProfile(ProfileID, InternetConnectionType.none); for (int i = 0; i < re.PayLoad.Length; i++) { string[] values = re.PayLoad[i].Split(','); if (values[0].IndexOf("^SICS") < 0) continue; if (values[0].Split(' ')[1].Equals(ProfileID.ToString())) { switch (values[1]) { case "\"alphabet\"": p.alphabet = values[2].Split('"')[1]; break; case "\"apn\"": p.apn = values[2].Split('"')[1]; break; case "\"calledNum\"": p.calledNum = values[2].Split('"')[1]; break; case "\"conType\"": p.conType = InternetConnectionProfile.GetInternetConnectionType(values[2]); break; case "\"dataType\"": p.dataType = values[2].Split('"')[1]; break; case "\"dns1\"": p.dns1 = values[2].Split('"')[1]; break; case "\"dns2\"": p.dns2 = values[2].Split('"')[1]; break; case "\"inactTO\"": p.inactTO = values[2].Split('"')[1]; break; case "\"passwd\"": p.passwd = values[2].Split('"')[1]; break; case "\"user\"": p.user = values[2].Split('"')[1]; break; } } } return p; } return null; }
public void Internet_Setup_Connection_Profile(int ProfileID, InternetConnectionType type, string APN, string username, string password) { InternetConnectionProfile p = new InternetConnectionProfile(ProfileID, type); p.user = username; p.passwd = password; p.apn = APN; Internet_Setup_Connection_Profile(p); }