채팅 소스인데요
이것을 avr에 연결하여 수신하면
12345678 이런식으로 와야되는데
2345
6781
이런식으로 잘려서 오는데 어떻게 해야되나요?
@Override
public void run() {
Log.i(TAG, "BEGIN mConnectedThread");
// byte[] buffer0 = new byte[0];
byte[] buffer = new byte[1024];
int bytes;
// Keep listening to the InputStream while connected
while (true) {
try {
// Read from the InputStream
// TODO: add dogkick!!
// bytes0 = mmInStream.read(buffer0);
bytes = mmInStream.read(buffer);
//end the obtained bytes to the UI Activity
mHandler.obtainMessage(MainController.MESSAGE_READ, bytes, -1, buffer)
.sendToTarget();
} catch (IOException e) {
Log.e(TAG, "disconnected", e);
connectionLost();
break;
}
}
}