public void disconnectEnflux()
    {
        if (operatingState == ConnectionState.CONNECTED)
        {
            StringBuilder returnBuffer = new StringBuilder(EnfluxVRSuit.MESSAGESIZE);

            if (EnfluxVRSuit.disconnect(connectedDevices.Count, returnBuffer) < 1)
            {
                Debug.Log("Devices disconnecting");
                operatingState = ConnectionState.DISCONNECTED;
                //scanUpdater.StartScanning();
            }
            else
            {
                Debug.Log(returnBuffer);
            }
        }
        if (operatingState == ConnectionState.DISCONNECTED)
        {
            // Already disconnected.
        }

        else
        {
            Debug.Log("Unable to disconnect, program is in wrong state "
                      + Enum.GetName(typeof(ConnectionState), operatingState));
        }
    }
Exemple #2
0
 public void disconnectEnflux()
 {
     if (operatingState == ConnectionState.CONNECTED)
     {
         if (EnfluxVRSuit.disconnect(connectedDevices.Count) < 1)
         {
             Debug.Log("Devices disconnected");
             client.Close();
             operatingState = ConnectionState.DISCONNECTED;
             scanUpdater.StartScanning();
         }
         else
         {
             Debug.Log("Problem disconnecting");
         }
     }
     else
     {
         Debug.Log("Unable to disconnect, program is in wrong state "
                   + Enum.GetName(typeof(ConnectionState), operatingState));
     }
 }