제가 어떤 블루투스 칩에 자동으로 블루투스 연결을 하고 메시지를 보내는 어플을 하나 만들려고 하는데요,
우선 핸드폰 블루투스를 자동으로 켜는 부분은 완료 했고,
BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);
BluetoothSocket tmp = null;
BluetoothSocket mmSocket = null;
// Get a BluetoothSocket for a connection with the
// given BluetoothDevice
try {
tmp = device.createRfcommSocketToServiceRecord(MY_UUID);
Method m = device.getClass().getMethod("createRfcommSocket", new Class[] {int.class});
tmp = (BluetoothSocket) m.invoke(device, 1);
} catch (IOException e) {
Log.e(TAG, "create() failed", e);
}
mmSocket = tmp;
라는 소스를 이용해 특정 mac주소로 몇초 간격으로 계속 페어링 시도와 메시지 전송을 반복하게 하려고 합니다.
이때, 블루투스에 비밀번호가 있는데, 그 비밀번호 입력하는 함수를 잘 모르겠네요
어떻게 해야하죠...?