Android Question AsyncStreams with bluetooth barcode reader

Discussion in 'Android Questions' started by GaNdAlF89, Feb 26, 2015.

  1. GaNdAlF89

    GaNdAlF89 Active Member Licensed User

    Hi, I want to read data from a barcode reader device. The barcode reader is correctly connected with a serial object. After this connection I do this:

    Code:
    AStreamReader.Initialize(BTSerialReader.InputStream,Null,"BTAStreamReader")
    but nothing happens when I read a barcode: neither BTAStreamReader_NewData nor BTAStreamReader_Error event is raised. Where is the problem? Thanks
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Make sure to also handle the Terminated event.

    If NewData is not raised then the barcode is not sending anything.

    This code is not in a static code module, right?
     
  3. GaNdAlF89

    GaNdAlF89 Active Member Licensed User

    When this event will be raised?
    I added the Terminated event, but there is no difference, it doesn't work..

    Yes, the code is in an activity module :)
     
    Last edited: Feb 27, 2015
  4. Erel

    Erel Administrator Staff Member Licensed User

    It is raised when the connection is terminated.
     
    Peter Simpson likes this.
  5. GaNdAlF89

    GaNdAlF89 Active Member Licensed User

    No event is raised, but the connection is established. I tried also with AsyncStreamsText but I have the same problem. Why?

    Edit: If I set the focus in an editText, the text is written.
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    Your barcode scanner is acting as an alternative keyboard. It is probably not sending any data through the SPP channel.
     
  7. GaNdAlF89

    GaNdAlF89 Active Member Licensed User

    I set it in SPP mode with its manual, reading a qrcode in particular. In this manual there is no other to do for SPP connection. What do you think I have to do to fix it? Thanks
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    Not sure. Assuming that you are handling the event correctly then the barcode isn't sending any data.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice