Page 462 - 2
P. 462
for (BluetoothDevice device : pairedDevices) {
Log.d(tag, " 기기이름 : " + device.getName() + " 기기주소 : " + device.getAddress());
if (device.getName().equals("raspberrypi"))
mdevice = device;
}
} else {
Log.d(tag, " 페어링된 기기가 없습니다.");
}
if (mdevice != null){
SetUUID(mdevice);
ConnectDevice();
}
}
synchronized public void Write_data(Bluetooth_Data data) {
try {
oout = new ObjectOutputStream(mmOutStream);
oout.writeObject(data);
oout.flush();
} catch (IOException ioe) {
Log.d(tag, " 데이터를 정송중 오류 : " + ioe.getMessage());
try {
oout.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
@Override
protected void onDestroy() {
super.onDestroy();
try {
bluetooth_manager.mmSocket.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
<Point_info>
package com.example.dbstp.mdp_2;
import java.io.Serializable;
public class Point_info implements Serializable{
- 462 -