コード例 #1
0
    //handles the Selected event
    public void OnSelected(BLEmanager bm)
    {     //populate the list
        if (_bleDevice == null)
        { //first time the button is clicked
            if (TextName.text.ToUpper().Contains("BLUNO"))
            {
                _bleDevice = new BlunoDevice(bm);
            }
            else if (TextName.text.ToUpper().Contains("BEAN"))
            {
                _bleDevice = new BeanDevice(bm);
            }
            else
            {
                BluetoothLEHardwareInterface.Log("Selected an unrecognized BLE device");
            }
        }

        if (_bleDevice != null)
        {//connect if the BLE device is recognized
            _bleDevice.OnConnect(TextName.text, TextAddress.text);
        }
    }
コード例 #2
0
ファイル: BlunoDevice.cs プロジェクト: thisisvictor/UnityBLE
 //constructor
 public BlunoDevice(BLEmanager bm)
 {
     _bleManager = bm;
 }
コード例 #3
0
    private BLEmanager _bleManager; //reference to the BLE manager object for calls

    //constructor
    public BeanDevice(BLEmanager bm)
    {
        _bleManager = bm;
    }