public void Connect(bool receiveHexData) { if (!ubwDeviceConnector.IsBusy) { deviceConnectionHelper.receiveHexData = receiveHexData; ubwDeviceConnector.Run(); } }
public void ReceiveData() { if (ubwByteDataReceiver != null && ubwByteDataReceiver.IsBusy) { ubwByteDataReceiver.Abort(); } ubwDataReceiver.Run(); }
public void SendAndReceiveData() { if (!ubwDataSenderAndReceiver.IsBusy) { Debug.Log("SendData"); dataSenderAndReceiverHelper.dataToSend = txtInput.text; ubwDataSenderAndReceiver.Run(); } }
/** * Permet d'initier la recherche * @param caller Le thread courant */ public void FindDevices(MonoBehaviour caller) { if (!isDevicesSearching) { ubw = new UnityBackgroundWorker(caller, FindDevicesBegin, FindDevicesProgress, FindDevicesDone, dfh); isDevicesSearching = true; ubw.Run(); } }
/** * Permet de commencer la vérification de communication entre l'application et les devices. * @param caller Le thread courant */ public void Start(MonoBehaviour caller) { dataReceiver = new UnityBackgroundWorker(caller, CheckDeviceBegin, CheckDeviceProgress, CheckDeviceDone, dataReceiverHelper); try { isRunning = true; dataReceiver.Run(); } catch (Exception e) { Debug.Log(e.Message); } }
public void FindDevices(bool performFastFind) { if (!ubwDeviceFinder.IsBusy) { txtAnswer.text += "Searching for the devices..\n"; deviceFinderHelper.performFastFind = performFastFind; deviceFinderHelper.performLoopFind = false; ubwDeviceFinder.Run(); } }
public void ReceiveByteData() { if (ubwDataReceiver != null && ubwDataReceiver.IsBusy) { ubwDataReceiver.Abort(); } ubwByteDataReceiver.Run(); //int maxLength = 512; //byte[] data = new byte[maxLength]; //int byteArrayLength=BTM_ReceiveByteDataFast(data, maxLength); //if(byteArrayLength==-1) //{ // Debug.Log("Error!"); //} //for(int i=0;i<byteArrayLength;i++) //{ // Debug.Log(i + ": " +(int)data[i]); //} }