Example #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;
            }
        }
Example #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;
            }
        }
Example #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;
            }
        }
Example #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);
        }
Example #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);
            }
        }
Example #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;
            }
        }
Example #7
0
        public PhonebookPage()
        {
            try
            {
                pb = new Phonebook(handle);
                handle.RegisterNotiEvent(Notification.PhonebookContactChange);
                handle.NotificationChanged += Handle_ContactChanged_NotiEvent;
            }

            catch (Exception ex)
            {
                Log.Debug(Globals.LogTag, "Pb constructor throws exception = " + ex.ToString());
            }

            var PhonebookInitInfoBtn = new Button
            {
                Text              = "PhonebookInitInfo",
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.FillAndExpand
            };

            PhonebookInitInfoBtn.Clicked += PhonebookInitInfoBtn_Clicked;

            var PhonebookStorageBtn = new Button
            {
                Text              = "Get Phonebook Storage",
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.FillAndExpand
            };

            PhonebookStorageBtn.Clicked += PhonebookStorageBtn_Clicked;

            var PhonebookMetaInfoBtn = new Button
            {
                Text              = "Get Phonebook MetaInfo",
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.FillAndExpand
            };

            PhonebookMetaInfoBtn.Clicked += PhonebookMetaInfoBtn_Clicked;

            var PhonebookMetaInfo3GBtn = new Button
            {
                Text              = "Get Phonebook MetaInfo3G",
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.FillAndExpand
            };

            PhonebookMetaInfo3GBtn.Clicked += PhonebookMetaInfo3GBtn_Clicked;

            var PhonebookReadRecordGBtn = new Button
            {
                Text              = "Read Phonebook record",
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.FillAndExpand
            };

            PhonebookReadRecordGBtn.Clicked += PhonebookReadRecordGBtn_Clicked;

            var PhonebookUpdateRecordGBtn = new Button
            {
                Text              = "Update Phonebook record",
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.FillAndExpand
            };

            PhonebookUpdateRecordGBtn.Clicked += PhonebookUpdateRecordGBtn_Clicked;

            var PhonebookDeleteRecordGBtn = new Button
            {
                Text              = "Delete Phonebook record",
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.FillAndExpand
            };

            PhonebookDeleteRecordGBtn.Clicked += PhonebookDeleteRecordGBtn_Clicked;

            Content = new StackLayout
            {
                VerticalOptions = LayoutOptions.Center,
                Children        =
                {
                    PhonebookInitInfoBtn,    PhonebookStorageBtn,       PhonebookMetaInfoBtn, PhonebookMetaInfo3GBtn,
                    PhonebookReadRecordGBtn, PhonebookUpdateRecordGBtn, PhonebookDeleteRecordGBtn
                }
            };
        }