kkohase / usb-serial-for-android

Automatically exported from code.google.com/p/usb-serial-for-android
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Communication garbled #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
 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

GoogleCodeExporter commented 9 years ago
Not a bug, most likely a problem with your application.  Please bring it up on 
the discussion list.

Original comment by mike.wak...@gmail.com on 22 May 2013 at 5:48