Exemple #1
0
        private async void powerBtn_Clicked(object sender, EventArgs e)
        {
            TapiHandle handle = Globals.handleModem0;

            try
            {
                Log.Debug(Globals.LogTag, "Sim set power state call start");
                handle.NotificationChanged += Handle_NotiPowerStateChanged;
                handle.RegisterNotiEvent(Notification.SimStatus);
                bool state = await sim.SimSetPowerState(SimPowerState.Off);

                if (state)
                {
                    await sim.SimSetPowerState(SimPowerState.On);
                }

                Log.Debug(Globals.LogTag, "Sim set power state call success");
            }

            catch (Exception ex)
            {
                Log.Debug(Globals.LogTag, "Sim set power state exception: " + ex.ToString());
            }

            finally
            {
                handle.DeregisterNotiEvent(Notification.SimStatus);
                handle.NotificationChanged -= Handle_NotiPowerStateChanged;
            }
        }
Exemple #2
0
        private async void processPowerBtn_Clicked(object sender, EventArgs e)
        {
            TapiHandle handle = Globals.handleModem0;

            try
            {
                handle.NotificationChanged += Handle_NotiPowerStatusChanged;
                handle.RegisterNotiEvent(Notification.ModemPower);
                Log.Debug(Globals.LogTag, "Modem powercommand call start");
                await modem.ProcessPowerCommand(PhonePowerCommand.Off);

                Log.Debug(Globals.LogTag, "Modem powercommand call off success");
            }

            catch (Exception ex)
            {
                Log.Debug(Globals.LogTag, "Modem processpower command ,exception = " + ex.ToString());
            }

            finally
            {
                handle.DeregisterNotiEvent(Notification.ModemPower);
                handle.NotificationChanged -= Handle_NotiPowerStatusChanged;
            }
        }
Exemple #3
0
        private async void setcwBtn_Clicked(object sender, EventArgs e)
        {
            TapiHandle handle = Globals.handleModem0;

            try
            {
                Log.Debug(Globals.LogTag, "Ss set call waiting start");
                handle.RegisterNotiEvent(Notification.SsNotifyWaiting);
                handle.NotificationChanged += Handle_CallWaitingNoti;
                SsWaitingInfo     info = new SsWaitingInfo(SsClass.Voice, SsCallWaitingMode.Activate);
                SsWaitingResponse resp = await ss.SsSetWaitingInfo(info);

                Log.Debug(Globals.LogTag, "Record number: " + resp.RecordNumber);
                List <SsWaitingRecord> rec = resp.Record.ToList();
                for (int i = 0; i < resp.RecordNumber; i++)
                {
                    Log.Debug(Globals.LogTag, "[" + i + "] Class: " + rec[i].Class);
                    Log.Debug(Globals.LogTag, "[" + i + "] Status: " + rec[i].Status);
                }

                Log.Debug(Globals.LogTag, "Ss set call waiting success");
            }

            catch (Exception ex)
            {
                Log.Debug(Globals.LogTag, "Ss set call waiting exception: " + ex.ToString());
            }

            finally
            {
                handle.DeregisterNotiEvent(Notification.SsNotifyWaiting);
                handle.NotificationChanged -= Handle_CallWaitingNoti;
            }
        }
Exemple #4
0
        private void RegisterNotiCallEvents(TapiHandle handle)
        {
            handle.PropertyChanged += Handle_CallPropertyChanged;

            handle.NotificationChanged += Handle_CallNotificationChanged;
            foreach (Notification i in arrNoti)
            {
                handle.RegisterNotiEvent(i);
            }
            handle.RegisterPropEvent(Property.NetworkPsType);
        }
Exemple #5
0
        private void RegisterNwEvents(TapiHandle handle)
        {
            handle.PropertyChanged += Handle_NwPropertyChanged;

            handle.NotificationChanged += Handle_NwNotificationChanged;
            foreach (Notification i in arrNoti)
            {
                handle.RegisterNotiEvent(i);
            }

            foreach (Property i in arrProp)
            {
                handle.RegisterPropEvent(i);
            }
        }
Exemple #6
0
        private async void setCfBtn_Clicked(object sender, EventArgs e)
        {
            TapiHandle handle = Globals.handleModem0;

            try
            {
                Log.Debug(Globals.LogTag, "Ss set call forward start");
                handle.RegisterNotiEvent(Notification.SsNotifyForwarding);
                handle.NotificationChanged += Handle_CallForwardNotiEvent;
                SsForwardInfo     cfInfo = new SsForwardInfo(SsClass.Voice, SsForwardMode.Enable, SsForwardCondition.NotReachable, SsNoReplyTime.Time5Secs, SsForwardTypeOfNumber.National, SsForwardNumberingPlanIdentity.National, "9589874552");
                SsForwardResponse resp   = await ss.SsSetForwardInfo(cfInfo);

                Log.Debug(Globals.LogTag, "Record num: " + resp.RecordNumber);
                List <SsForwardRecord> rec = resp.Record.ToList();
                for (int i = 0; i < resp.RecordNumber; i++)
                {
                    Log.Debug(Globals.LogTag, "[" + i + "] Class: " + rec[i].Class);
                    Log.Debug(Globals.LogTag, "[" + i + "] Status: " + rec[i].Status);
                    Log.Debug(Globals.LogTag, "[" + i + "] ForwardCondition: " + rec[i].ForwardCondition);
                    Log.Debug(Globals.LogTag, "[" + i + "] IsFwNumPresent: " + rec[i].IsForwardingNumberPresent);
                    Log.Debug(Globals.LogTag, "[" + i + "] NoReplyTime:: " + rec[i].NoReplyTime);
                    Log.Debug(Globals.LogTag, "[" + i + "] Ton: " + rec[i].Ton);
                    Log.Debug(Globals.LogTag, "[" + i + "] Npi: " + rec[i].Npi);
                    Log.Debug(Globals.LogTag, "[" + i + "] Number: " + rec[i].ForwardingNumber);
                }

                Log.Debug(Globals.LogTag, "Ss set call forward success");
            }

            catch (Exception ex)
            {
                Log.Debug(Globals.LogTag, "Ss set call forward exception: " + ex.ToString());
            }

            finally
            {
                handle.DeregisterNotiEvent(Notification.SsNotifyForwarding);
                handle.NotificationChanged -= Handle_CallForwardNotiEvent;
            }
        }