Esempio n. 1
0
 private bool createHubAndPair()
 {
     try {
         _hub = new Thalmic.Myo.Hub();
     } catch (System.Exception) {
         Debug.Log("ThalmicHub failed to initialize.");
         return(false);
     }
     _hub.Paired += hub_MyoPaired;
     if (pairingMethod == PairingMethod.Any)
     {
         _hub.PairWithAnyMyos((uint)_myos.Count);
     }
     else if (pairingMethod == PairingMethod.Adjacent)
     {
         _hub.PairWithAdjacentMyos((uint)_myos.Count);
     }
     else if (pairingMethod == PairingMethod.ByMacAddress)
     {
         _hub.PairByMacAddress(Thalmic.Myo.libmyo.string_to_mac_address(pairingMacAddress));
     }
     return(true);
 }