コード例 #1
0
    internal BluetoothDevice(string deviceString)
    {
        string[] tokens = deviceString.Split(new string[] { BluetoothMultiplayerAndroid.Delimiter }, StringSplitOptions.None);

        name      = tokens[0].Trim();
        address   = tokens[1];
        bondState = (BondState)UInt16.Parse(tokens[2]);

        if (name == "")
        {
            name = address;
        }
    }
コード例 #2
0
    internal BluetoothDevice(AndroidJavaObject bluetoothDeviceJavaObject)
    {
        if (IsAndroidJavaObjectNull(bluetoothDeviceJavaObject))
        {
            name      = "";
            address   = "";
            bondState = BondState.None;
            return;
        }
        name      = bluetoothDeviceJavaObject.Call <string>("getName").Trim();
        address   = bluetoothDeviceJavaObject.Call <string>("getAddress");
        bondState = (BondState)bluetoothDeviceJavaObject.Call <int>("getBondState");

        if (name == "")
        {
            name = address;
        }
    }
コード例 #3
0
    internal BluetoothDevice(AndroidJavaObject bluetoothDeviceJavaObject) {
        if (IsAndroidJavaObjectNull(bluetoothDeviceJavaObject)) {
            name = "";
            address = "";
            bondState = BondState.None;
            return;
        }
        name = bluetoothDeviceJavaObject.Call<string>("getName").Trim();
        address = bluetoothDeviceJavaObject.Call<string>("getAddress");
        bondState = (BondState) bluetoothDeviceJavaObject.Call<int>("getBondState");

        if (name == "")
            name = address;
    }
コード例 #4
0
    internal BluetoothDevice(string deviceString) {
        string[] tokens = deviceString.Split(new string[] { BluetoothMultiplayerAndroid.Delimiter }, StringSplitOptions.None);

        name = tokens[0].Trim();
        address = tokens[1];
        bondState = (BondState) UInt16.Parse(tokens[2]);

        if (name == "")
            name = address;
    }