コード例 #1
0
        private void Handle_NwNotificationChanged(object sender, NotificationChangedEventArgs e)
        {
            try
            {
                Log.Debug(Globals.LogTag, "Handle_NwNotificationChanged event receive, Notification Value = " + e.Id);
                switch (e.Id)
                {
                case Notification.NetworkCellInfo:
                    NetworkCellNoti data = (NetworkCellNoti)e.Data;
                    Log.Debug(Globals.LogTag, "NetworkCellInfo event receive, Lac = " + data.Lac + ", cell id = " + data.CellId);
                    break;

                case Notification.NetworkRegistrationStatus:
                    NetworkRegistrationStatus status = (NetworkRegistrationStatus)e.Data;
                    Log.Debug("NetworkRegistrationStatus event receive , circuit status = ", status.CircuitStatus + ", isroaming = " + status.IsRoaming + ", packetstatus = " + status.PacketStatus + ", type = " + status.Type);
                    break;

                case Notification.NetworkIdentity:
                    NetworkIdentityNoti noti = (NetworkIdentityNoti)e.Data;
                    Log.Debug("NetworkIdentity event receive , fullname = ", noti.FullName + ", plmn = " + noti.Plmn + ", shortname = " + noti.ShortName);
                    break;

                case Notification.NetworkChange:
                    NetworkChangeNoti changeNoti = (NetworkChangeNoti)e.Data;
                    Log.Debug("NetworkChange event receive , plmn = ", changeNoti.Plmn + ", act = " + changeNoti.Act);
                    break;

                case Notification.NetworkDefaultDataSubscription:
                    Log.Debug(Globals.LogTag, "NetworkDefaultDataSubscription event receive, data = " + e.Data);
                    break;

                case Notification.NetworkDefaultSubscription:
                    Log.Debug(Globals.LogTag, "NetworkDefaultSubscription event receive, data = " + e.Data);
                    break;
                }
            }

            catch (Exception ex)
            {
                Log.Debug(Globals.LogTag, "Handle_NwNotificationChanged event exception = " + ex.ToString());
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: yangcq/SmartLab_BGS2
 private static void M_OnNetworkRegistrationChanged(NetworkRegistrationStatus status, string netLac, string netCellId)
 {
     Console.WriteLine(status);
     Console.WriteLine(netLac + " " + netCellId);
 }