예제 #1
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;
            }
        }