Plugin() public method

public Plugin ( int serial ) : bool
serial int
return bool
        public virtual Boolean Resume()
        {
            LogDebug("++ Resumed");

            for (Int32 Index = 0; Index < m_Pad.Length; Index++)
            {
                if (m_Pad[Index].State != DeviceState.Disconnected)
                {
                    scpBus.Plugin(Index + 1);
                }
            }

            usbHub.Resume();
            bthHub.Resume();

            m_Suspended = false;
            return(true);
        }
Beispiel #2
0
        public override bool Resume()
        {
            Log.Debug("++ Resumed");

            _scpBus.Resume();
            for (var index = 0; index < _pads.Length; index++)
            {
                if (_pads[index].State != DsState.Disconnected)
                {
                    _scpBus.Plugin(index + 1);
                }
            }

            _usbHub.Resume();
            _bthHub.Resume();

            _mSuspended = false;
            return(true);
        }
Beispiel #3
0
        protected override void On_Arrival(object sender, ArrivalEventArgs e)
        {
            lock (this)
            {
                Boolean   bFound  = false;
                IDsDevice Arrived = e.Device;

                for (Int32 Index = 0; Index < m_Pad.Length && !bFound; Index++)
                {
                    if (Arrived.Local == m_Reserved[Index])
                    {
                        if (m_Pad[Index].State == DsState.Connected)
                        {
                            if (m_Pad[Index].Connection == DsConnection.BTH)
                            {
                                m_Pad[Index].Disconnect();
                            }

                            if (m_Pad[Index].Connection == DsConnection.USB)
                            {
                                Arrived.Disconnect();

                                e.Handled = false;
                                return;
                            }
                        }

                        bFound = true;

                        Arrived.PadId = (DsPadId)Index;
                        m_Pad[Index]  = Arrived;
                    }
                }

                for (Int32 Index = 0; Index < m_Pad.Length && !bFound; Index++)
                {
                    if (m_Pad[Index].State == DsState.Disconnected)
                    {
                        bFound            = true;
                        m_Reserved[Index] = Arrived.Local;

                        Arrived.PadId = (DsPadId)Index;
                        m_Pad[Index]  = Arrived;
                    }
                }

                if (bFound)
                {
                    scpBus.Plugin((int)Arrived.PadId + 1);

                    LogDebug(String.Format("++ Plugin Port #{0} for [{1}]", (int)Arrived.PadId + 1, Arrived.Local));
                }
                e.Handled = bFound;
            }
        }