I use the usb-serial-for-android packet in android4.0 device to communication with my Embedded.But, sometimes I send data to my device is garbled.And communication with PC is right.The code is below.every can tell me,anywhere is error?
if(mSerialDevice != null)
{
mSerialDevice.open();
mSerialDevice.setParameters(9600,8,1,0);
byte[] send_data = {0x01,0x03,0x00,0x10,0x00,0x04,0,0};
byte[] read_buffer = new byte[64];
short crc = CheckCRC(6,send_data);
send_data[7] = (byte)(crc & 0xff);
send_data[6] = (byte)(crc>>8);
synchronized(mSerialDevice)
{
try
{
mSerialDevice.write(send_data, 8);
}catch(IOException e){}
}
}
Original issue reported on code.google.com by kamond...@gmail.com on 11 Apr 2013 at 11:20
Original issue reported on code.google.com by
kamond...@gmail.com
on 11 Apr 2013 at 11:20