-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBluetooth.pde
More file actions
38 lines (30 loc) · 884 Bytes
/
Bluetooth.pde
File metadata and controls
38 lines (30 loc) · 884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
boolean BTstatus =false;
ArrayList<String> devicesConnected = new ArrayList();
ArrayList<String> devicesPaired= new ArrayList();
ArrayList<String> devicesDiscovered= new ArrayList();
KetaiBluetooth bt;
public void btSetting() {
bt.start();
bt.discoverDevices();
}
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
bt = new KetaiBluetooth(this);
}
public void onActivityResult(int requestCode, int resultCode, Intent data) {
bt.onActivityResult(requestCode, resultCode, data);
}
//check connection of printer
public void checkConnection() {
devicesConnected = bt.getConnectedDeviceNames();
if (devicesConnected.size() == 0) {
BTstatus = false;
}
if (devicesConnected.size()>0) {
BTstatus = true;
}
}
//select paired device
public void BTselection() {
klist =new KetaiList(this, bt.getDiscoveredDeviceNames());
}