public override bool Start() { m_Started = true; if (_device.State == DsState.Reserved) { _device.Start(); } return(m_Started); }
public override DsPadId Notify(ScpDevice.Notified notification, string Class, string Path) { Log.DebugFormat("++ Notify [{0}] [{1}] [{2}]", notification, Class, Path); switch (notification) { case ScpDevice.Notified.Arrival: { if (_device.State != DsState.Connected) { var arrived = new BthDongle(); if (arrived.Open(Path)) { Log.DebugFormat("-- Device Arrival [{0}]", arrived.Local); _device.Close(); _device = arrived; _device.Arrival += On_Arrival; _device.Report += On_Report; if (m_Started) { _device.Start(); } break; } arrived.Close(); arrived.Dispose(); } } break; case ScpDevice.Notified.Removal: if (_device.Path == Path) { Log.DebugFormat("-- Device Removal [{0}]", _device.Local); _device.Stop(); } break; } return(DsPadId.None); }
public override DsPadId Notify(ScpDevice.Notified notification, string Class, string path) { Log.DebugFormat("++ Notify [{0}] [{1}] [{2}]", notification, Class, path); switch (notification) { case ScpDevice.Notified.Arrival: { if (_device.State != DsState.Connected) { var arrived = new BthDongle(); if (arrived.Open(path)) { Log.DebugFormat("-- Device Arrival [{0}]", arrived.BluetoothHostAddress.AsFriendlyName()); _device.Close(); _device = arrived; _device.DeviceArrived += OnDeviceArrival; _device.HidReportReceived += OnHidReportReceived; if (m_Started) { _device.Start(); } break; } arrived.Close(); arrived.Dispose(); } } break; case ScpDevice.Notified.Removal: if (_device.Path == path) { Log.DebugFormat("-- Device Removal [{0}]", _device.BluetoothHostAddress.AsFriendlyName()); _device.Stop(); } break; } return(DsPadId.None); }
public override DsPadId Notify(ScpDevice.Notified notification, string Class, string path) { Log.DebugFormat("++ Notify [{0}] [{1}] [{2}]", notification, Class, path); switch (notification) { case ScpDevice.Notified.Arrival: { if (_device.State != DsState.Connected) { var arrived = new BthDongle(); if (arrived.Open(path)) { Log.DebugFormat("-- Device Arrival [{0}]", arrived.BluetoothHostAddress.AsFriendlyName()); _device.Close(); _device = arrived; _device.DeviceArrived += OnDeviceArrival; _device.HidReportReceived += OnHidReportReceived; if (m_Started) _device.Start(); break; } arrived.Close(); arrived.Dispose(); } } break; case ScpDevice.Notified.Removal: if (_device.Path == path) { Log.DebugFormat("-- Device Removal [{0}]", _device.BluetoothHostAddress.AsFriendlyName()); _device.Stop(); } break; } return DsPadId.None; }
public override DsPadId Notify(ScpDevice.Notified notification, string Class, string Path) { Log.DebugFormat("++ Notify [{0}] [{1}] [{2}]", notification, Class, Path); switch (notification) { case ScpDevice.Notified.Arrival: { if (_device.State != DsState.Connected) { var arrived = new BthDongle(); if (arrived.Open(Path)) { Log.DebugFormat("-- Device Arrival [{0}]", arrived.Local); _device.Close(); _device = arrived; _device.Arrival += On_Arrival; _device.Report += On_Report; if (m_Started) _device.Start(); break; } arrived.Close(); arrived.Dispose(); } } break; case ScpDevice.Notified.Removal: if (_device.Path == Path) { Log.DebugFormat("-- Device Removal [{0}]", _device.Local); _device.Stop(); } break; } return DsPadId.None; }
public override DsPadId Notify(ScpDevice.Notified notification, string Class, string Path) { Log.DebugFormat("++ Notify [{0}] [{1}] [{2}]", notification, Class, Path); switch (notification) { case ScpDevice.Notified.Arrival: { if (_device.State != DsState.Connected) { var arrived = new BthDongle(); if (arrived.Open(Path)) { Log.DebugFormat("-- Device Arrival [{0}]", arrived.Local); _device.Close(); _device = arrived; _device.DeviceArrived += OnDeviceArrival; _device.HidReportReceived += OnHidReportReceived; if (m_Started) _device.Start(); break; } arrived.Close(); arrived.Dispose(); } } break; case ScpDevice.Notified.Removal: if (_device.Path == Path) { Log.DebugFormat("-- Device Removal [{0}]", _device.Local); AudioPlayer.Instance.PlayCustomFile(GlobalConfiguration.Instance.BluetoothDisconnectSoundFile); _device.Stop(); } break; } return DsPadId.None; }