예제 #1
0
 private void OnBtDeviceDisconnected(LWBluetoothDevice device)
 {
     this._connectedTo          = null;
     this._connectedToText.text = "";
     this._btnDisconnect.gameObject.SetActive(false);
     this._btnPairedDevices.gameObject.SetActive(true);
 }
예제 #2
0
 private void OnBtDeviceConnected(LWBluetoothDevice device)
 {
     this._connectedTo          = device;
     this._connectedToText.text = device.GetName();
     this._btnDisconnect.gameObject.SetActive(true);
     this._btnPairedDevices.gameObject.SetActive(false);
 }
예제 #3
0
    private void BTEventsHandler_BTPaired(LWBluetoothDevice device)
    {
        _chatText.text += "\nDevice paired.";
        myDevice        = device;
        IList <string> uuid_list = NativeBTRuntime.NBTR.BTWrapper.GetUUIDS(device);

        myDeviceUUID = uuid_list[0];
        //int a = NativeBTRuntime.NBTR.BTWrapper.GetUUIDS(newDevices[0]);
        _chatText.text += "\nDevice UUID is: ";
        foreach (string _u in uuid_list)
        {
            _chatText.text += "\n" + _u;
        }
        _chatText.text += "\nmyDeviceUUID is: " + myDeviceUUID;
    }
예제 #4
0
 private void BTEventsHandler_BTDeviceFound(LWBluetoothDevice device)
 {
     if (newDevices.Count > 0)
     {
         bool _contain = false;
         // if current device is in device then don't add in
         foreach (LWBluetoothDevice _d in newDevices)
         {
             if (_d.GetHashCode() == device.GetHashCode() ||
                 _d.GetAddress() == device.GetAddress())
             {
                 _contain = true;
             }
         }
         if (!_contain)
         {
             newDevices.Add(device);
         }
     }
     else if (newDevices.Count == 0)
     {
         newDevices.Add(device);                             // if device list is empty then add current one
     }
 }
예제 #5
0
 private void BTEventsHandler_BTPairingFailed(LWBluetoothDevice device)
 {
     _chatText.text += "\nPair filed!!!";
 }
예제 #6
0
 private void BTEventsHandler_BTDeviceConnecting(LWBluetoothDevice device)
 {
     _chatText.text += "\nConnecting to " + device.GetName();
 }
예제 #7
0
 public void OnPairedDeviceButtonClicked(LWBluetoothDevice btDevice)
 {
     NativeBTRuntime.NBTR.BTWrapper.Connect(btDevice, this.uuid);
     this._pairedDeviceList.gameObject.SetActive(false);
 }
예제 #8
0
    //*/
    /// <summary>
    ///
    /// </summary>
    /// <param name="device"></param>

    private void OnBTDeviceConnectingFailed(LWBluetoothDevice device)
    {
        this._connectedToText.text = "Connecting to " + device.GetName() + " failed!";
    }
예제 #9
0
 private void BTEventsHandler_BTPairingRequest(LWBluetoothDevice device)
 {
     _chatText.text += "\nStarting pair ... ...";
 }