|
|
|
@ -15,6 +15,7 @@ import android.graphics.Color;
|
|
|
|
import android.os.Build;
|
|
|
|
import android.os.Build;
|
|
|
|
import com.bjzc.blemanager.BluetoothLeService;
|
|
|
|
import com.bjzc.blemanager.BluetoothLeService;
|
|
|
|
import android.os.Handler;
|
|
|
|
import android.os.Handler;
|
|
|
|
|
|
|
|
import android.text.TextUtils;
|
|
|
|
import android.util.Log;
|
|
|
|
import android.util.Log;
|
|
|
|
import android.view.LayoutInflater;
|
|
|
|
import android.view.LayoutInflater;
|
|
|
|
import android.view.View;
|
|
|
|
import android.view.View;
|
|
|
|
@ -44,9 +45,11 @@ import com.rehome.dywoa.Contans;
|
|
|
|
import com.rehome.dywoa.R;
|
|
|
|
import com.rehome.dywoa.R;
|
|
|
|
import com.rehome.dywoa.adapter.XzjhAdapter;
|
|
|
|
import com.rehome.dywoa.adapter.XzjhAdapter;
|
|
|
|
import com.rehome.dywoa.base.BaseActivity;
|
|
|
|
import com.rehome.dywoa.base.BaseActivity;
|
|
|
|
|
|
|
|
import com.rehome.dywoa.utils.GsonUtils;
|
|
|
|
import com.rehome.dywoa.utils.SPUtils;
|
|
|
|
import com.rehome.dywoa.utils.SPUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@ -56,7 +59,9 @@ import java.util.List;
|
|
|
|
public class BlueToothDeviceActivity extends BaseActivity {
|
|
|
|
public class BlueToothDeviceActivity extends BaseActivity {
|
|
|
|
|
|
|
|
|
|
|
|
ListView lv;
|
|
|
|
ListView lv;
|
|
|
|
TextView tx_data;
|
|
|
|
TextView ble_status;
|
|
|
|
|
|
|
|
TextView ble_dianlang;
|
|
|
|
|
|
|
|
TextView tvNodata;
|
|
|
|
private BluetoothAdapter mBluetoothAdapter;
|
|
|
|
private BluetoothAdapter mBluetoothAdapter;
|
|
|
|
private ArrayList<String> mPermissionList = new ArrayList();
|
|
|
|
private ArrayList<String> mPermissionList = new ArrayList();
|
|
|
|
private BluetoothLeScanner bluetoothLeScanner;
|
|
|
|
private BluetoothLeScanner bluetoothLeScanner;
|
|
|
|
@ -72,6 +77,10 @@ public class BlueToothDeviceActivity extends BaseActivity {
|
|
|
|
private BleManager ble;
|
|
|
|
private BleManager ble;
|
|
|
|
private int selectItem = -1;
|
|
|
|
private int selectItem = -1;
|
|
|
|
private String cmd = "";
|
|
|
|
private String cmd = "";
|
|
|
|
|
|
|
|
private String str="";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String deviceNameSave;
|
|
|
|
|
|
|
|
private String deviceAddressSave;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public int getContentViewID() {
|
|
|
|
public int getContentViewID() {
|
|
|
|
@ -81,11 +90,23 @@ public class BlueToothDeviceActivity extends BaseActivity {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void initView() {
|
|
|
|
public void initView() {
|
|
|
|
lv = findViewById(R.id.lv);
|
|
|
|
lv = findViewById(R.id.lv);
|
|
|
|
tx_data = findViewById(R.id.tx_data);
|
|
|
|
ble_status = findViewById(R.id.ble_status);
|
|
|
|
|
|
|
|
ble_dianlang = findViewById(R.id.ble_dianlang);
|
|
|
|
|
|
|
|
tvNodata = findViewById(R.id.tv_nodata);
|
|
|
|
|
|
|
|
|
|
|
|
ble= BleManager.getInstance();
|
|
|
|
ble= BleManager.getInstance();
|
|
|
|
String str=ble.init(BlueToothDeviceActivity.this);
|
|
|
|
str=ble.init(BlueToothDeviceActivity.this);
|
|
|
|
showLog(str);
|
|
|
|
showLog(str);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
deviceNameSave = (String) SPUtils.get(context, Contans.KEY_BLUE_TOOTH_NAME,"");
|
|
|
|
|
|
|
|
showLog("-------deviceNameSave-------");
|
|
|
|
|
|
|
|
showLog(deviceNameSave);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
deviceAddressSave = (String) SPUtils.get(context, Contans.KEY_BLUE_TOOTH_ADDRESS,"");
|
|
|
|
|
|
|
|
showLog("-------deviceAddressSave-------");
|
|
|
|
|
|
|
|
showLog(deviceAddressSave);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if("BLE is not supported".equals(str)){
|
|
|
|
if("BLE is not supported".equals(str)){
|
|
|
|
showToast("当前设备不支持低功耗蓝牙,无法连接传感器采集数据");
|
|
|
|
showToast("当前设备不支持低功耗蓝牙,无法连接传感器采集数据");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -119,12 +140,16 @@ public class BlueToothDeviceActivity extends BaseActivity {
|
|
|
|
// for ActivityCompat#requestPermissions for more details.
|
|
|
|
// for ActivityCompat#requestPermissions for more details.
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
showLog("扫描发现设备" + device.getName() + "," + device.getAddress());
|
|
|
|
//showLog("扫描发现设备" + device.getName() + "," + device.getAddress());
|
|
|
|
String deviceName = device.getName();
|
|
|
|
//String deviceName = device.getName();
|
|
|
|
if (deviceName != null && !deviceName.isEmpty()&&deviceName.startsWith("W3")){
|
|
|
|
if (device !=null && device.getName() != null && device.getName().startsWith("W3")){
|
|
|
|
//showLog(new Gson().toJson(device));
|
|
|
|
showLog(new Gson().toJson(device));
|
|
|
|
mLeDeviceListAdapter.addDevice(device);
|
|
|
|
mLeDeviceListAdapter.addDevice(device);
|
|
|
|
mLeDeviceListAdapter.notifyDataSetChanged();
|
|
|
|
mLeDeviceListAdapter.notifyDataSetChanged();
|
|
|
|
|
|
|
|
if(!TextUtils.isEmpty(deviceNameSave) && !TextUtils.isEmpty(deviceAddressSave)){
|
|
|
|
|
|
|
|
selectItem=0;
|
|
|
|
|
|
|
|
ble.connect(deviceAddressSave,deviceNameSave);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (BluetoothLeService.ACTION_GATT_CONNECTED.equals(action)) {
|
|
|
|
} else if (BluetoothLeService.ACTION_GATT_CONNECTED.equals(action)) {
|
|
|
|
showLog("连接");
|
|
|
|
showLog("连接");
|
|
|
|
@ -132,47 +157,69 @@ public class BlueToothDeviceActivity extends BaseActivity {
|
|
|
|
mLeDeviceListAdapter.notifyDataSetChanged();
|
|
|
|
mLeDeviceListAdapter.notifyDataSetChanged();
|
|
|
|
|
|
|
|
|
|
|
|
BluetoothDevice device = mLeDeviceListAdapter.getDevice(selectItem);
|
|
|
|
BluetoothDevice device = mLeDeviceListAdapter.getDevice(selectItem);
|
|
|
|
|
|
|
|
SPUtils.put(context, Contans.KEY_BLUE_TOOTH,new Gson().toJson(device));
|
|
|
|
String deviceName = device.getName();
|
|
|
|
String deviceName = device.getName();
|
|
|
|
|
|
|
|
String deviceAddress = device.getAddress();
|
|
|
|
if (deviceName != null && !deviceName.isEmpty()){
|
|
|
|
if (deviceName != null && !deviceName.isEmpty()){
|
|
|
|
SPUtils.put(context, Contans.KEY_BLUE_TOOTH,device.getAddress());
|
|
|
|
showLog(deviceName);
|
|
|
|
|
|
|
|
showLog(deviceAddress);
|
|
|
|
|
|
|
|
SPUtils.put(context, Contans.KEY_BLUE_TOOTH_ADDRESS,deviceAddress);
|
|
|
|
|
|
|
|
SPUtils.put(context, Contans.KEY_BLUE_TOOTH_NAME,device.getName());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (BluetoothLeService.ACTION_GATT_DISCONNECTED.equals(action)) {
|
|
|
|
} else if (BluetoothLeService.ACTION_GATT_DISCONNECTED.equals(action)) {
|
|
|
|
showLog("断开");
|
|
|
|
showLog("断开");
|
|
|
|
} else if (BluetoothLeService.ACTION_GATT_SERVICES_DISCOVERED.equals(action)) {
|
|
|
|
} else if (BluetoothLeService.ACTION_GATT_SERVICES_DISCOVERED.equals(action)) {
|
|
|
|
showLog("数据传输通道准备就绪,可以发送数据了。");
|
|
|
|
showLog("数据传输通道准备就绪,可以发送数据了。");
|
|
|
|
|
|
|
|
ble_status.setText("已连接");
|
|
|
|
|
|
|
|
ble_status.setTextColor(Color.parseColor("#00FF7F"));//连接之后的颜色
|
|
|
|
|
|
|
|
new Handler().postDelayed(new Runnable() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void run() {
|
|
|
|
|
|
|
|
ble.write("BV", false);
|
|
|
|
|
|
|
|
cmd="BV";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},2000);
|
|
|
|
} else if (BluetoothLeService.ACTION_DATA_AVAILABLE.equals(action)) {
|
|
|
|
} else if (BluetoothLeService.ACTION_DATA_AVAILABLE.equals(action)) {
|
|
|
|
byte[] data= intent.getByteArrayExtra(BluetoothLeService.EXTRA_DATA);
|
|
|
|
byte[] data= intent.getByteArrayExtra(BluetoothLeService.EXTRA_DATA);
|
|
|
|
String resultReceive = new String(data);
|
|
|
|
String resultReceive = new String(data);
|
|
|
|
showLog("收到传感器数据" + resultReceive);
|
|
|
|
showLog("收到传感器数据" + resultReceive);
|
|
|
|
if("VR".equals(cmd)){
|
|
|
|
if("BV".equals(cmd)){
|
|
|
|
showLog(resultReceive);
|
|
|
|
showLog(resultReceive);
|
|
|
|
}else{
|
|
|
|
if(!TextUtils.isEmpty(resultReceive)){
|
|
|
|
tx_data.setText("接收数值:"+resultReceive);
|
|
|
|
List<String> listDianLiang = stringToListBlank(resultReceive);
|
|
|
|
|
|
|
|
if(!listDianLiang.isEmpty()){
|
|
|
|
|
|
|
|
showLog(listDianLiang.get(0));
|
|
|
|
|
|
|
|
showLog(listDianLiang.get(1));
|
|
|
|
|
|
|
|
List<String> strDianLiang = stringToList(listDianLiang.get(0));
|
|
|
|
|
|
|
|
if(!strDianLiang.isEmpty()){
|
|
|
|
|
|
|
|
ble_dianlang.setText(strDianLiang.get(1)+strDianLiang.get(0));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if("0F3101".equals(cmd)){
|
|
|
|
if("0B0B6300".equals(cmd)){
|
|
|
|
ble.write("VR", false);
|
|
|
|
showLog(resultReceive);
|
|
|
|
cmd="VR";
|
|
|
|
if(!TextUtils.isEmpty(resultReceive)){
|
|
|
|
|
|
|
|
List<String> listDianLiang = stringToListBlank(resultReceive);
|
|
|
|
|
|
|
|
if(!listDianLiang.isEmpty()){
|
|
|
|
|
|
|
|
showLog(listDianLiang.get(0));
|
|
|
|
|
|
|
|
showLog(listDianLiang.get(1));
|
|
|
|
|
|
|
|
List<String> strDianLiang = stringToList(listDianLiang.get(0));
|
|
|
|
|
|
|
|
if(!strDianLiang.isEmpty()){
|
|
|
|
|
|
|
|
ble_dianlang.setText(strDianLiang.get(1)+"℃");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
initToolbar("蓝牙数据管理", "扫描并确认", new View.OnClickListener() {
|
|
|
|
initToolbar("蓝牙数据管理", "扫描蓝牙", new View.OnClickListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onClick(View v) {
|
|
|
|
public void onClick(View v) {
|
|
|
|
showLog("蓝牙数据管理");
|
|
|
|
showLog("蓝牙数据管理");
|
|
|
|
mLeDeviceListAdapter.clear();
|
|
|
|
blueScan();
|
|
|
|
mLeDeviceListAdapter.notifyDataSetChanged();
|
|
|
|
|
|
|
|
//initBlueTooth();
|
|
|
|
|
|
|
|
// if(BleManager.getInstance().isSupportBle()){
|
|
|
|
|
|
|
|
// initBlueToothFastBle();
|
|
|
|
|
|
|
|
// }else{
|
|
|
|
|
|
|
|
// showToast("当前设备不支持低功耗蓝牙,无法连接传感器采集数据");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
if("OK".equals(str)){
|
|
|
|
|
|
|
|
ble.scan();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
//BleManager.getInstance().init(getApplication());
|
|
|
|
//BleManager.getInstance().init(getApplication());
|
|
|
|
@ -199,11 +246,6 @@ public class BlueToothDeviceActivity extends BaseActivity {
|
|
|
|
selectItem=position;
|
|
|
|
selectItem=position;
|
|
|
|
ble.connect(device.getAddress(),device.getName());
|
|
|
|
ble.connect(device.getAddress(),device.getName());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, new LeDeviceListAdapter.CallBackBlueToothUnBind() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void Click(int position) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, new LeDeviceListAdapter.CallBackBlueToothSendData() {
|
|
|
|
}, new LeDeviceListAdapter.CallBackBlueToothSendData() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void Click(int position) {
|
|
|
|
public void Click(int position) {
|
|
|
|
@ -214,6 +256,7 @@ public class BlueToothDeviceActivity extends BaseActivity {
|
|
|
|
//ble.write("BV", false);
|
|
|
|
//ble.write("BV", false);
|
|
|
|
//温度测量
|
|
|
|
//温度测量
|
|
|
|
ble.write("0B0B6300", true);
|
|
|
|
ble.write("0B0B6300", true);
|
|
|
|
|
|
|
|
cmd="0B0B6300";
|
|
|
|
//距离测量
|
|
|
|
//距离测量
|
|
|
|
//ble.write("4453", true);
|
|
|
|
//ble.write("4453", true);
|
|
|
|
//转速测量
|
|
|
|
//转速测量
|
|
|
|
@ -231,16 +274,26 @@ public class BlueToothDeviceActivity extends BaseActivity {
|
|
|
|
lv.setAdapter(mLeDeviceListAdapter);
|
|
|
|
lv.setAdapter(mLeDeviceListAdapter);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void blueScan(){
|
|
|
|
|
|
|
|
mLeDeviceListAdapter.clear();
|
|
|
|
|
|
|
|
mLeDeviceListAdapter.notifyDataSetChanged();
|
|
|
|
|
|
|
|
ble.disconnect();
|
|
|
|
|
|
|
|
selectItem = -1;
|
|
|
|
|
|
|
|
if("OK".equals(str)){
|
|
|
|
|
|
|
|
ble.scan();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void initData() {
|
|
|
|
public void initData() {
|
|
|
|
|
|
|
|
blueScan();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onDestroy() {
|
|
|
|
protected void onDestroy() {
|
|
|
|
super.onDestroy();
|
|
|
|
super.onDestroy();
|
|
|
|
ble.scan();
|
|
|
|
//ble.disconnect();
|
|
|
|
ble.disconnect();
|
|
|
|
ble.free();
|
|
|
|
// if(BleManager.getInstance().getScanSate()== BleScanState.STATE_SCANNING){
|
|
|
|
// if(BleManager.getInstance().getScanSate()== BleScanState.STATE_SCANNING){
|
|
|
|
// BleManager.getInstance().cancelScan();
|
|
|
|
// BleManager.getInstance().cancelScan();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
@ -432,23 +485,20 @@ public class BlueToothDeviceActivity extends BaseActivity {
|
|
|
|
TextView deviceName;
|
|
|
|
TextView deviceName;
|
|
|
|
TextView deviceStatus;
|
|
|
|
TextView deviceStatus;
|
|
|
|
TextView deviceBind;
|
|
|
|
TextView deviceBind;
|
|
|
|
TextView deviceDeBind;
|
|
|
|
|
|
|
|
TextView sendData;
|
|
|
|
TextView sendData;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private ArrayList<BluetoothDevice> mLeDevices;
|
|
|
|
private ArrayList<BluetoothDevice> mLeDevices;
|
|
|
|
private LayoutInflater mInflator;
|
|
|
|
private LayoutInflater mInflator;
|
|
|
|
private CallBackBlueToothBind callBackBlueToothBind;
|
|
|
|
private CallBackBlueToothBind callBackBlueToothBind;
|
|
|
|
private CallBackBlueToothUnBind callBackBlueToothUnBind;
|
|
|
|
|
|
|
|
private CallBackBlueToothSendData callBackBlueToothSendData;
|
|
|
|
private CallBackBlueToothSendData callBackBlueToothSendData;
|
|
|
|
|
|
|
|
|
|
|
|
public LeDeviceListAdapter(CallBackBlueToothBind callBackBlueToothBind,CallBackBlueToothUnBind callBackBlueToothUnBind,
|
|
|
|
public LeDeviceListAdapter(CallBackBlueToothBind callBackBlueToothBind,
|
|
|
|
CallBackBlueToothSendData callBackBlueToothSendData) {
|
|
|
|
CallBackBlueToothSendData callBackBlueToothSendData) {
|
|
|
|
super();
|
|
|
|
super();
|
|
|
|
mLeDevices = new ArrayList<BluetoothDevice>();
|
|
|
|
mLeDevices = new ArrayList<BluetoothDevice>();
|
|
|
|
mInflator = BlueToothDeviceActivity.this.getLayoutInflater();
|
|
|
|
mInflator = BlueToothDeviceActivity.this.getLayoutInflater();
|
|
|
|
this.callBackBlueToothBind=callBackBlueToothBind;
|
|
|
|
this.callBackBlueToothBind=callBackBlueToothBind;
|
|
|
|
this.callBackBlueToothUnBind=callBackBlueToothUnBind;
|
|
|
|
|
|
|
|
this.callBackBlueToothSendData=callBackBlueToothSendData;
|
|
|
|
this.callBackBlueToothSendData=callBackBlueToothSendData;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -456,10 +506,6 @@ public class BlueToothDeviceActivity extends BaseActivity {
|
|
|
|
void Click(int position);
|
|
|
|
void Click(int position);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public interface CallBackBlueToothUnBind {
|
|
|
|
|
|
|
|
void Click(int position);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public interface CallBackBlueToothSendData {
|
|
|
|
public interface CallBackBlueToothSendData {
|
|
|
|
void Click(int position);
|
|
|
|
void Click(int position);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -502,7 +548,6 @@ public class BlueToothDeviceActivity extends BaseActivity {
|
|
|
|
viewHolder.deviceName = view.findViewById(R.id.device_name);
|
|
|
|
viewHolder.deviceName = view.findViewById(R.id.device_name);
|
|
|
|
viewHolder.deviceStatus = view.findViewById(R.id.device_status);
|
|
|
|
viewHolder.deviceStatus = view.findViewById(R.id.device_status);
|
|
|
|
viewHolder.deviceBind = view.findViewById(R.id.device_bind);
|
|
|
|
viewHolder.deviceBind = view.findViewById(R.id.device_bind);
|
|
|
|
viewHolder.deviceDeBind = view.findViewById(R.id.device_de_bind);
|
|
|
|
|
|
|
|
viewHolder.sendData = view.findViewById(R.id.send_data);
|
|
|
|
viewHolder.sendData = view.findViewById(R.id.send_data);
|
|
|
|
view.setTag(viewHolder);
|
|
|
|
view.setTag(viewHolder);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@ -546,14 +591,6 @@ public class BlueToothDeviceActivity extends BaseActivity {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
viewHolder.deviceDeBind.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
|
|
|
if(callBackBlueToothUnBind!=null){
|
|
|
|
|
|
|
|
callBackBlueToothUnBind.Click(i);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
viewHolder.sendData.setOnClickListener(new View.OnClickListener() {
|
|
|
|
viewHolder.sendData.setOnClickListener(new View.OnClickListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onClick(View v) {
|
|
|
|
public void onClick(View v) {
|
|
|
|
@ -574,4 +611,12 @@ public class BlueToothDeviceActivity extends BaseActivity {
|
|
|
|
|
|
|
|
|
|
|
|
private int selectItem = -1;
|
|
|
|
private int selectItem = -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private List<String> stringToList(String strs) {
|
|
|
|
|
|
|
|
String str[] = strs.split(":");
|
|
|
|
|
|
|
|
return Arrays.asList(str);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private List<String> stringToListBlank(String strs) {
|
|
|
|
|
|
|
|
String str[] = strs.split("\n");
|
|
|
|
|
|
|
|
return Arrays.asList(str);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|