블루투스 데모소스(BluetoothChat)를 이용해서 PC에서 블로투스 동글이를 이용해서 랜덤으로 연속적으로 데이타를 보내면 폰에서는 데이타를 받는 형식으로 만들어 봤습니다
byte[] buffer = new byte[1024];
int bytes;
// Keep listening to the InputStream while connected
while (true) {
try {
// Read from the InputStream
bytes = mmInStream.read();
// Send the obtained bytes to the UI Activity
Toast.makeText(getApplicationContext(), String.valueOf(bytes), 5).show();
} catch (IOException e) {
Log.e(TAG, "disconnected", e);
connectionLost();
// Start the service over to restart listening mode
BluetoothChatService.this.start();
break;
}
}
분명히 연속적으로 다른 데이타를 보내는데 받기는 똑같은 데이타만 받습니다
종료햇다가 다시 실행시키면 이전과는 다른 데이타만 받습니다 그렇다고 데이타가 변하면서 받지는 못합니다
다른 사람이 마든 블루투스 어플(스토어에서 다운)에서는 연속적으로 다른 데이타를 받습니다
왜 연속적으로 다른 데이타를 받지못하고 똑같은 데이타를 받을까요?