예제 #1
0
 private void handleBleIdle()
 {
     /* Entering here must mean an error happened; just try to restart */
     BleApi.StartDeviceScan();
     state = BleState.SCANNING;
     Debug.Log("Restart scanning for devices");
 }
예제 #2
0
    // Start is called before the first frame update
    void Start()
    {
        /* Start scanning */
        BleApi.StartDeviceScan();
        state = BleState.SCANNING;
        Debug.Log("Scanning for devices");

        InvokeRepeating("executeHandUpdate", SendRateSeconds, SendRateSeconds);
    }
예제 #3
0
 public void StartStopDeviceScan()
 {
     if (!isScanningDevices)
     {
         // start new scan
         for (int i = scanResultRoot.childCount - 1; i >= 0; i--)
         {
             Destroy(scanResultRoot.GetChild(i).gameObject);
         }
         BleApi.StartDeviceScan();
         isScanningDevices         = true;
         deviceScanButtonText.text = "Stop scan";
         deviceScanStatusText.text = "scanning";
     }
     else
     {
         // stop scan
         isScanningDevices = false;
         BleApi.StopDeviceScan();
         deviceScanButtonText.text = "Start scan";
         deviceScanStatusText.text = "stopped";
     }
 }