示例#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
 //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;
    }