Example #1
0
        public InternetConnectionInfo Internet_Connection_Information(int ProfileID)
        {
            GeneralResponse re = SendATCommand("AT^SICI=" + ProfileID);
            if (re.IsSuccess)
            {
                string[] values = re.PayLoad[0].Split(',');

                if (values[0].IndexOf("^SICI") >= 0)
                {
                    InternetConnectionInfo info = new InternetConnectionInfo();
                    info.ProfileID = ProfileID;
                    info.Status = (InternetConnectionStatus)int.Parse(values[1]);
                    info.NumberOfServices = int.Parse(values[2]);
                    info.IPAddress = values[3].Split('"')[1];
                    return info;
                }
            }

            return null;
        }
Example #2
0
        public InternetConnectionInfo[] Internet_Connection_Information()
        {
            GeneralResponse re = SendATCommand("AT^SICI?");
            if (re.IsSuccess)
            {
                InternetConnectionInfo[] info = new InternetConnectionInfo[re.PayLoad.Length];
                for (int i = 0; i < re.PayLoad.Length; i++)
                {
                    string[] values = re.PayLoad[i].Split(',');
                    info[i] = new InternetConnectionInfo();

                    if (values[0].IndexOf("^SICI") < 0)
                        continue;

                    info[i].ProfileID = int.Parse(values[0].Split(' ')[1]);
                    info[i].Status = (InternetConnectionStatus)int.Parse(values[1]);
                    info[i].NumberOfServices = int.Parse(values[2]);
                    info[i].IPAddress = values[3].Split('"')[1];
                }
                return info;
            }

            return null;
        }