Android Open Source - bluetooth-spp-terminal Device Data






From Project

Back to project page bluetooth-spp-terminal.

License

The source code is released under:

Apache License

If you think the Android project bluetooth-spp-terminal listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package ru.sash0k.bluetooth_terminal;
/*  w ww .ja v a  2  s  .  c  om*/
import java.util.ArrayList;

import android.bluetooth.BluetoothDevice;
import android.os.ParcelUuid;

import ru.sash0k.bluetooth_terminal.bluetooth.BluetoothUtils;


public class DeviceData {
    private String name = "";
    private String address = "";
    private int bondState = BluetoothDevice.BOND_NONE;
    private ArrayList<ParcelUuid> uuids = null;
    private final int deviceClass;
    private final int majorDeviceClass;

    public DeviceData(BluetoothDevice device, String emptyName) {
        name = device.getName();
        address = device.getAddress();
        bondState = device.getBondState();

        if (name == null || name.isEmpty()) name = emptyName;
        deviceClass = device.getBluetoothClass().getDeviceClass();
        majorDeviceClass = device.getBluetoothClass().getMajorDeviceClass();
        uuids = BluetoothUtils.getDeviceUuids(device);
    }

    public String getName() {
        return name;
    }

    public void setName(String deviceName) {
        name = deviceName;
    }

    public String getAddress() {
        return address;
    }

    public int getDeviceClass() {
        return deviceClass;
    }

    public int getMajorDeviceClass() {
        return majorDeviceClass;
    }

    public void setBondState(int state) {
        bondState = state;
    }

    public ArrayList<ParcelUuid> getUuids() {
        return uuids;
    }

    public int getBondState() {
        return bondState;
    }
}




Java Source Code List

ru.sash0k.bluetooth_terminal.Const.java
ru.sash0k.bluetooth_terminal.DeviceData.java
ru.sash0k.bluetooth_terminal.Utils.java
ru.sash0k.bluetooth_terminal.activity.BaseActivity.java
ru.sash0k.bluetooth_terminal.activity.DeviceControlActivity.java
ru.sash0k.bluetooth_terminal.activity.SettingsActivity.java
ru.sash0k.bluetooth_terminal.bluetooth.BluetoothUtils.java
ru.sash0k.bluetooth_terminal.bluetooth.DeviceConnector.java
ru.sash0k.bluetooth_terminal.bluetooth.DeviceListActivity.java