private void NotifyDeviceAvailable(Interop.Plantronics.ICOMDevice dev) { m_availableDevices.Clear(); // note: only 1 call control device for pc spokes PLTDevice deviceTmp = new PLTDevice(dev); m_availableDevices.Add(deviceTmp); if (m_constructordone) { m_callbackhandler.DeviceAdded(deviceTmp); // tell connected app that a Plantronics // device was added (or selected as call control device in Spokes 3.0 control panel). // Connected app may then choose to make a PLTLabsAPI connection to this device // for purpose of reading sensor data from it. } }
/// <summary> /// Call this method to instruct device to open a connection to the /// specified device. Once connected you will be able to subscribe /// to data services of the device. /// </summary> /// <param name="aDevice">Pass the PLTDevice object you want to connect to.</param> public void openConnection(PLTDevice aDevice) { if (m_activeConnection != null) { return; } // TODO in future instruct Spokes to change call control device // to passed PLTDevice (not currently available with Spokes 3.0 // in which we are already attached to the 1 call control device) // just register for raw data received to receive sensor data m_spokes.RawDataReceived += new Spokes.RawDataReceivedEventHandler(m_spokes_RawDataReceived); m_isConnectToDevice = true; m_activeConnection = new PLTConnection(m_spokes, this, aDevice); m_callbackhandler.ConnectionOpen(m_activeConnection); }
internal PLTConnection(Spokes aSpokesConnection, PLTLabsAPI aPLTLabsAPI, PLTDevice aDevice) { m_spokes = aSpokesConnection; m_pltlabsapi = aPLTLabsAPI; m_device = aDevice; }
/// <summary> /// Call this method to find out if a particular device is attached or not. /// </summary> /// <param name="aDevice">The PLTDevice you want to check if it is connected</param> /// <returns>Returns true if the device is connected</returns> public bool getIsConnected(PLTDevice aDevice) { return(m_isConnectToDevice); }