AKIN
AKIN
Gaziantep
22/12/2014 tarihinden beri üye
10 GY Puanı
99K GY Sırası

Kişisel Sayfaları

İlgi Alanları

1 Rozet
0 Sertifika
1 Soru Sordu
0 Cevap Verdi
0 Blog Yazısı
0 Etiket Takibi

Hakkında

İş Tecrubesi

Kullanıcıya ait İş tecrübesi bilgisi bulunmamaktadır.

Eğitim Geçmişi

Gaziantep Üniversitesi
| Aralık 2020 - Aralık 2020

Sertifikalar & Başarılar

GY Sertifikaları (0)
Kullanıcının GY sertifikası bulunmamaktadır.
Diğer Sertifikaları (0)
Kullanıcıya ait sertifika bulunmamaktadır.
Test Sonuçları (0)

Kullanıcıya ait test sonucu bulunmamaktadır.

Dil Becerileri

Son Forum Aktiviteleri

1
Tümünü Gör

Neden buffer'dan veri okuyamıyorum

HTerm'den inputu 'a' olarak gönderiyorum fakat android tablet ekranından output ' Incoming message = [B@411149f8 ' olarak görülüyor. 

public void TestSerialllll(View view) throws InterruptedException, IOException {

    byte[] PrintBuffer ;
    PrintBuffer = new byte[2048];
    byte res = ReadSerialData(PrintBuffer , (byte)PrintBuffer.length);

    if (res == 0) {

       text2.setText("Incoming message = " + PrintBuffer);

    }
}

private byte ReadSerialData(byte[] buffer , int len){

    if (sDriver == null) {
        mTitleTextView.setText("No serial device.");
    } else {

        try {
            sDriver.open();
            sDriver.setParameters(115200, 8, UsbSerialDriver.STOPBITS_1, UsbSerialDriver.PARITY_NONE);

            sDriver.read(buffer, 2000);
            len = buffer.length;

        } catch (IOException e) {
            Log.e(TAG, "Error setting up device: " + e.getMessage(), e);
            mTitleTextView.setText("Error opening device: " + e.getMessage());
            try {
                sDriver.close();
            } catch (IOException e2) {
                // Ignore.
            }
            sDriver = null;
            return 1;
        }
        mTitleTextView.setText("Serial device: " + sDriver.getClass().getSimpleName());
    }

    return 0;
}