if (is != null)
{
int read_bytes = is.read(byte_array, 0, BUFFER_SIZE);
- byte[] receive_body = Arrays.copyOfRange(byte_array, 0, read_bytes);
+ byte[] receive_body;
+ if (read_bytes > 4)
+ {
+ receive_body = Arrays.copyOfRange(byte_array, 0, read_bytes);
+ }
+ else
+ {
+ receive_body = new byte[1];
+ }
if (isDumpReceiveLog)
{
// ログに受信メッセージを出力する
@Override
public void receivedMessage(int id, byte[] rx_body)
{
+ Log.v(TAG, "receivedMessage : " + id + "[" + rx_body.length + " bytes]");
switch (id)
{
case SEQ_REGISTRATION:
if (rx_body.length == (int)rx_body[0])
{
// なぜかもうちょっとデータが飛んでくるので待つ
- commandIssuer.enqueueCommand(new StartReceiveOnly(this));
+ //commandIssuer.enqueueCommand(new StartReceiveOnly(this));
+
+ commandIssuer.enqueueCommand(new StartMessage3rd(this));
}
else
{