Esempio n. 1
0
        public override HEADSET_LIMITATIONS Initalize(IDeviceHost host)
        {
            this.host = host;
            device.SetButtonEventHandler(OnButtonEvent);
            device.SetStateEventHandler(OnStateEvent);

            host.StatusChanged += HostStatusChanged;
            return HEADSET_LIMITATIONS.ONLY_ACTIVE_DURING_CALLS;
        }
        public override HEADSET_LIMITATIONS Initalize(IDeviceHost host)
        {
            this.host = host;

            device.DeviceEvents.MuteStateChanged += DeviceEvents_MuteStateChanged;
            device.DeviceEvents.FlashPressed += DeviceEvents_FlashPressed;
            device.DeviceEvents.TalkPressed += DeviceEvents_TalkPressed;
            device.DeviceEvents.AudioStateChanged += DeviceEvents_AudioStateChanged;
            device.DeviceEvents.ButtonPressed += DeviceEvents_ButtonPressed;
            host.StatusChanged += HostStatusChanged;
            return HEADSET_LIMITATIONS.NO_UNMUTE;
        }
Esempio n. 3
0
 public abstract HEADSET_LIMITATIONS Initalize(IDeviceHost host);
Esempio n. 4
0
 private void HostStatusChanged(object sender, IDeviceHost.StatusEventArgs e)
 {
     switch (e.type) {
         case IDeviceHost.PHONE_EVENT_TYPE.InCallRing:
         case IDeviceHost.PHONE_EVENT_TYPE.Ring:
             device.SetRinger(e.enable, last_caller_id);
             break;
         case IDeviceHost.PHONE_EVENT_TYPE.LineActive:
             if (e.enable == false && muted)
                 device.SetMicrophoneMute(false);
             device.SetHookState(e.enable);
             hook_enabled = e.enable;
             break;
         case IDeviceHost.PHONE_EVENT_TYPE.Mute:
             device.SetMicrophoneMute(e.enable);
             muted = e.enable;
             break;
     }
 }
 private void HostStatusChanged(object sender, IDeviceHost.StatusEventArgs e)
 {
     switch (e.type) {
         case IDeviceHost.PHONE_EVENT_TYPE.InCallRing:
         case IDeviceHost.PHONE_EVENT_TYPE.Ring:
             device.HostCommand.Ring(e.enable);
             break;
         case IDeviceHost.PHONE_EVENT_TYPE.LineActive:
             ignore_next_radio_on = e.enable;
             device.HostCommand.AudioState = e.enable ? PL.AudioType.MonoOn : PL.AudioType.MonoOff;
             break;
     }
 }
Esempio n. 6
0
 public abstract HEADSET_LIMITATIONS Initalize(IDeviceHost host);
Esempio n. 7
0
        private void CreateEvent(IDeviceHost.PHONE_EVENT_TYPE type, bool enable, bool is_during_call)
        {
            List<PluginError> errors = null;

            lock (devices_lock) {
                foreach (DeviceData data in devices) {
                    if (!data.active)
                        continue;
                    try {
                        if (type != IDeviceHost.PHONE_EVENT_TYPE.LineActive)
                            data.host.CreateEvent(type, enable);
                        else {
                            if (data.HasLimit(IHeadsetDevice.HEADSET_LIMITATIONS.ONLY_ACTIVE_DURING_CALLS)) {
                                if (is_during_call)
                                    data.host.CreateEvent(type, enable);
                            }
                            else if (!is_during_call)
                                data.host.CreateEvent(type, enable);
                        }
                    }
                    catch (Exception e) {
                        if (errors == null)
                            errors = new List<PluginError>();
                        errors.Add(new PluginError { device = data, exception = e });

                    }
                }
            }

            if (errors != null)
                foreach (PluginError err in errors)
                    HandleError(err);
        }
Esempio n. 8
0
 private void CreateEvent(IDeviceHost.PHONE_EVENT_TYPE type, bool enable)
 {
     CreateEvent(type, enable, false);
 }