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"); }
// 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); }
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"; } }