⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ril.cs

📁 C# RIL FOR WINDOWS MOBILE5
💻 CS
📖 第 1 页 / 共 3 页
字号:
        NUM = 0x00000003
    }


    [StructLayout(LayoutKind.Sequential)]
    private struct RILOPERATORNAMES
    {
        public Int32 cbSize;
        public Int32 dwParams;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = RIL.MAXLENGTH_OPERATOR_LONG)]
        public byte[] szLongName;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = RIL.MAXLENGTH_OPERATOR_SHORT)]
        public byte[] szShortName;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = RIL.MAXLENGTH_OPERATOR_NUMERIC)]
        public byte[] szNumName;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = RIL.MAXLENGTH_OPERATOR_COUNTRY_CODE)]
        public byte[] szCountryCode;
    }

    public class OPERATORNAMES
    {
      public string LongName;
      public string ShortName;
      public string NumName;
      public string CountryCode;
      public OPERATORNAMES(string LongName, string ShortName, string NumName, string CountryCode)
      {
        this.LongName = LongName;
        this.ShortName = ShortName;
        this.NumName = NumName;
        this.CountryCode = CountryCode;
      }
    }
    #endregion

    #region CELLINFO struct
    public class CELLINFO
    {
      public string MobileCountryCode;
      public string MobileNetworkCode;
      public string LocationAreaCode;
      public string CellID;
      public string RxLevel;
      public string RxQuality;
      public CELLINFO(string MobileCountryCode, string MobileNetworkCode, string LocationAreaCode, string CellID, string RxLevel, string RxQuality)
      {
        this.MobileCountryCode = MobileCountryCode;
        this.MobileNetworkCode = MobileNetworkCode;
        this.LocationAreaCode  = LocationAreaCode;
        this.CellID = CellID;
        this.RxLevel = RxLevel;
        this.RxQuality = RxQuality;
      }
    }

    [StructLayout(LayoutKind.Sequential)]
    private struct RILCELLTOWERINFO
    {
        public UInt32 cbSize;                       // @field structure size in bytes
        public UInt32 dwParams;                     // @field indicates valid parameters
        public UInt32 dwMobileCountryCode;          // @field TBD
        public UInt32 dwMobileNetworkCode;          // @field TBD
        public UInt32 dwLocationAreaCode;           // @field TBD
        public UInt32 dwCellID;                     // @field TBD
        public UInt32 dwBaseStationID;              // @field TBD
        public UInt32 dwBroadcastControlChannel;    // @field TBD
        public UInt32 dwRxLevel;                    // @field Value from 0-63 (see GSM 05.08, 8.1.4)
        public UInt32 dwRxLevelFull;                // @field Value from 0-63 (see GSM 05.08, 8.1.4)
        public UInt32 dwRxLevelSub;                 // @field Value from 0-63 (see GSM 05.08, 8.1.4)
        public UInt32 dwRxQuality;                  // @field Value from 0-7  (see GSM 05.08, 8.2.4)
        public UInt32 dwRxQualityFull;              // @field Value from 0-7  (see GSM 05.08, 8.2.4)
        public UInt32 dwRxQualitySub;               // @field Value from 0-7  (see GSM 05.08, 8.2.4)
        public UInt32 dwIdleTimeSlot;               // @field TBD
        public UInt32 dwTimingAdvance;              // @field TBD
        public UInt32 dwGPRSCellID;                 // @field TBD
        public UInt32 dwGPRSBaseStationID;          // @field TBD
        public UInt32 dwNumBCCH;                    // @field TBD
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = RIL.MAXLENGTH_BCCH)]
        public byte[] rgbBCCH;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = RIL.MAXLENGTH_NMR)]
        public byte[] rgbNMR;
    }
    #endregion

    #region SIGNALQUALITY struct
    [StructLayout(LayoutKind.Sequential)]
    private struct RILSIGNALQUALITY
    {
        public UInt32 cbSize;                       // @field structure size in bytes
        public UInt32 dwParams;                     // @field indicates valid parameters          
        public Int32  nSignalStrength;                // @field TBD
        public Int32  nMinSignalStrength;             // @field TBD
        public Int32  nMaxSignalStrength;             // @field TBD
        public UInt32 dwBitErrorRate;               // @field bit error rate in 1/100 of a percent
        public Int32  nLowSignalStrength;             // @field TBD
        public Int32  nHighSignalStrength;            // @field TBD
    }

    
    #endregion

    #region Equipment Info struct
    public class EQUIPMENTINFO
    {
      public string Manufacturer;
      public string Model;
      public string Revision;
      public string SerialNumber;
      public EQUIPMENTINFO(string Manufacturer, string Model, string Revision, string SerialNumber)
      {
        this.Manufacturer = Manufacturer;
        this.Model = Model;
        this.Revision = Revision;
        this.SerialNumber = SerialNumber;
      }
    }

    [StructLayout(LayoutKind.Sequential)]
    private struct RILEQUIPMENTINFO
    {
      public UInt32 cbSize;                       // @field structure size in bytes
      public UInt32 dwParams;                     // @field indicates valid parameters
      [MarshalAs(UnmanagedType.ByValArray, SizeConst = RIL.MAXLENGTH_EQUIPINFO)]
      public byte[] szManufacturer;
      [MarshalAs(UnmanagedType.ByValArray, SizeConst = RIL.MAXLENGTH_EQUIPINFO)]
      public byte[] szModel;
      [MarshalAs(UnmanagedType.ByValArray, SizeConst = RIL.MAXLENGTH_EQUIPINFO)]
      public byte[] szRevision;
      [MarshalAs(UnmanagedType.ByValArray, SizeConst = RIL.MAXLENGTH_EQUIPINFO)]
      public byte[] szSerialNumber;
    }
    #endregion

    #region Subscriber Info struct
    public class SUBSCRIBERINFO
    {
      public string Address;
      public string Description;
      public string Speed;
      public string Service;
      public string ITC;
      public string AddressID;
      public SUBSCRIBERINFO(string Address, string Description, string Speed, string Service, string ITC, string AddressID)
      {
        this.Address = Address;
        this.Description = Description;
        this.Speed = Speed;
        this.Service= Service;
        this.ITC = ITC;
        this.AddressID = AddressID;
      }
    }

    [StructLayout(LayoutKind.Sequential)]
    private struct RILADDRESS
    {
      public UInt32 cbSize;                       // @field structure size in bytes
      public UInt32 dwParams;                     // @field indicates valid parameters
      public UInt32 dwType;                       // @field type of number
      public UInt32 dwNumPlan;                    // @field numbering plan
      [MarshalAs(UnmanagedType.ByValArray, SizeConst = RIL.MAXLENGTH_ADDRESS)]
      public byte[] wszAddress;
    }

    [StructLayout(LayoutKind.Sequential)]
    private struct RILSUBSCRIBERINFO
    {
      public UInt32 cbSize;                       // @field structure size in bytes
      public UInt32 dwParams;                     // @field indicates valid parameters
      public UInt32 cbSize2;
      public UInt32 dwParams2;
      public UInt32 dwType2;
      public UInt32 dwNumPlan;
      [MarshalAs(UnmanagedType.ByValArray, SizeConst = RIL.MAXLENGTH_ADDRESS)]
      public byte[] wszAddress;                   // @field the assigned address
      //RILADDRESS raAddress;                       // @field the assigned address
      [MarshalAs(UnmanagedType.ByValArray, SizeConst = RIL.MAXLENGTH_DESCRIPTION)]
      public byte[] wszDescription;               // @field text relating to this subscriber
      public UInt32 dwSpeed;                      // @field data rate related to this number
      public UInt32 dwService;                    // @field the service related to this number
      public UInt32 dwITC;                        // @field information transfer capability
      public UInt32 dwAddressId;                  // @field the address ID of this number
    }
    #endregion

  }
  public class SIGNALQUALITY
  {
      public string SignalStrength;                // @field TBD
      public string MinSignalStrength;             // @field TBD
      public string MaxSignalStrength;             // @field TBD
      public string BitErrorRate;               // @field bit error rate in 1/100 of a percent
      public string LowSignalStrength;             // @field TBD
      public string HighSignalStrength;            // @field TBD             

      public SIGNALQUALITY(string SignalStrength, string MinSignalStrength, string MaxSignalStrength, string BitErrorRate, string LowSignalStrength, string HighSignalStrength)
      {
          this.SignalStrength = SignalStrength;
          this.MinSignalStrength = MinSignalStrength;
          this.MaxSignalStrength = MaxSignalStrength;
          this.BitErrorRate = BitErrorRate;
          this.LowSignalStrength = LowSignalStrength;
          this.HighSignalStrength = HighSignalStrength;
      }
  }
  public class RIL_EVENTS
  {
      public RIL_EVENTS()
      {
      }
      #region Events
      public delegate void SignalQualityChangedSelectedHandler(SIGNALQUALITY signal);
      public event SignalQualityChangedSelectedHandler SignalQualityChanged;
      #endregion

      public void RiseSignalQualityChanged(SIGNALQUALITY signal)
      {
           if (SignalQualityChanged != null)
           {
               SignalQualityChanged(signal);
           }
      }
  }
 }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -