Giter Site home page Giter Site logo

Comments (17)

akexorcist avatar akexorcist commented on June 21, 2024

Did you have error log from LogCat of this problem?

from bluetoothspplibrary.

davix10 avatar davix10 commented on June 21, 2024

bt.setOnDataReceivedListener(new OnDataReceivedListener() {
public void onDataReceived(byte[] data, String message) {
//Toast.makeText(MainActivity.this, message, Toast.LENGTH_SHORT).show();
byte[] readBuf = (byte[]) data;
try
{
valore_a_16 = ((readBuf[1] & 0xFF) << 8) | (readBuf[0] & 0xFF);
a++;
}
catch(IndexOutOfBoundsException ioob){
ioob.printStackTrace();
}

            String str = String.valueOf(a);

            //  Log.d("byte", str);
            text.setText(str);
        }
    });

I solved in this way, but I do not understand why I do not get all the data that my tool sends the bluetooth. My tool transfers data every 1-2ms. The library is not so fast in transferring the data?

from bluetoothspplibrary.

chichidinoy avatar chichidinoy commented on June 21, 2024

Hai did you use the bluetooth terminal in getting the data ??????

from bluetoothspplibrary.

davix10 avatar davix10 commented on June 21, 2024

yes, why?

from bluetoothspplibrary.

chichidinoy avatar chichidinoy commented on June 21, 2024

Im working on, a bluetooth mobile to get a data from a receiver.
I also uses Bluetooth Terminal.

But it seems I cant get the data after I send a command..
This is the command..
GetTruckInfo xx.xx.xx

and I expect some result.
But I don’t get it.

Can you help?
Besst Regards,
Mae
From: davix10
Sent: Wednesday, November 19, 2014 1:03 AM
To: akexorcist/Android-BluetoothSPPLibrary
Cc: Cherrie Mae Dinoy
Subject: Re: [Android-BluetoothSPPLibrary] Data received error (#2)

yes, why?


Reply to this email directly or view it on GitHub.

from bluetoothspplibrary.

davix10 avatar davix10 commented on June 21, 2024

What do not you understand?

from bluetoothspplibrary.

chichidinoy avatar chichidinoy commented on June 21, 2024

I am a newbie in bluetooth android.

I build a program using eclipse.
and I want to read and write a data to a bluetooth device.
Do you know how i can do that?
I already achieve the pairing and scanning the devices,\

But sending a commands and getting the data in a bluetooth devices doesnt work.
Do you know how i can do that??

from bluetoothspplibrary.

akexorcist avatar akexorcist commented on June 21, 2024

I want to ask some question for sure. Did your device communicate with Bluetooth Serial Port Profile? Because I never seen any bluetooth device which using XML Format on Serial Port Profile. May it using another bluetooth protocol?

from bluetoothspplibrary.

chichidinoy avatar chichidinoy commented on June 21, 2024

Hello akexocist,

I had my weekends and never able to checked my mail. Sorry for the late reply,.
Yes, my device communicate via bluetooth serial port profile. I tried to download your bluetooth terminal and it was connected . I even
tried it to any SPP application.(Bluetooth chat, blueterm ) I was connected but my problem is. he is not accepting my commands.
Or I don’t even get any responds. Yes it is connected. but when I try to send any “String” I don’t get any respond.

if it is using another bluetooth protocol?
How is that??

From: Akexorcist
Sent: Saturday, November 22, 2014 6:24 AM
To: akexorcist/Android-BluetoothSPPLibrary
Cc: Cherrie Mae Dinoy
Subject: Re: [Android-BluetoothSPPLibrary] Data received error (#2)

I want to ask some question for sure. Did your device communicate with Bluetooth Serial Port Profile? Because I never seen any bluetooth device which using XML Format on Serial Port Profile. May it using another bluetooth protocol?


Reply to this email directly or view it on GitHub.

from bluetoothspplibrary.

akexorcist avatar akexorcist commented on June 21, 2024

Try to check on your device datasheet that really Serial Port Profile? I think your device is work on Bluetooth 4.0 Low Energy. If yes, that's not Serial Port Profile. but it's worked on Bluetooth Low Energy Protocol.

from bluetoothspplibrary.

chichidinoy avatar chichidinoy commented on June 21, 2024

Hello Akexorcit,

http://teholabs.com/docs/bluescripts:overview, Ive seen an example. This one sends XML Format commands, That was a BluetoothScript.
But the scripts really differs,
He has this script:

<script>
Script Name

00:11:22:33:44:55
some ASCII message

    <action>...</action>
</script>
<script>...</script>
...

but my script is so different


GetReceiverParameters
05.1A.8C

I wonder if this are de same,

From: Akexorcist
Sent: Sunday, November 23, 2014 10:36 PM
To: akexorcist/Android-BluetoothSPPLibrary
Cc: Cherrie Mae Dinoy
Subject: Re: [Android-BluetoothSPPLibrary] Data received error (#2)

Try to check on your device datasheet that really Serial Port Profile? I think your device is work on Bluetooth 4.0 Low Energy. If yes, that's not Serial Port Profile. but it's worked on Bluetooth Low Energy Protocol.


Reply to this email directly or view it on GitHub.

from bluetoothspplibrary.

akexorcist avatar akexorcist commented on June 21, 2024

Oh! Bluetooth Script, I never heard that before. So you need to built xml script file and sent to your target device.

from bluetoothspplibrary.

chichidinoy avatar chichidinoy commented on June 21, 2024

But sir I still have problem. In his script he has standard format. This one:

<script> Say Hello 00:11:22:33:44:55 Hello SSP Radio </script> but my command is like this: GetReceiverParameters 05.1A.8C

Ive tired my command but its not working..

From: Akexorcist
Sent: Sunday, November 23, 2014 11:21 PM
To: akexorcist/Android-BluetoothSPPLibrary
Cc: Cherrie Mae Dinoy
Subject: Re: [Android-BluetoothSPPLibrary] Data received error (#2)

Oh! Bluetooth Script, I never heard that before. So you need to built xml script file and sent to your target device.


Reply to this email directly or view it on GitHub.

from bluetoothspplibrary.

akexorcist avatar akexorcist commented on June 21, 2024

Don't worry about data format. It's depending on target device. Just try it.

from bluetoothspplibrary.

chichidinoy avatar chichidinoy commented on June 21, 2024

Okay I will try . I will follow the XML Command that my device accepts.
Thanks akexorcist.

Best Regards,
Mae

From: Akexorcist
Sent: Monday, November 24, 2014 9:21 AM
To: akexorcist/Android-BluetoothSPPLibrary
Cc: Cherrie Mae Dinoy
Subject: Re: [Android-BluetoothSPPLibrary] Data received error (#2)

Don't worry about data format. It's depending on target device. Just try it.


Reply to this email directly or view it on GitHub.

from bluetoothspplibrary.

chichidinoy avatar chichidinoy commented on June 21, 2024

its not working. Now I find it really imposible to send the XML command using mobile.
Am I correct bluetooth only accepts “AT Commands”?
because I notice , that commads was sent using terminal in a loptop
or I guess that was a Putty Configuration. They use to send the command den they get some result.

Is it posible to android to work like putty / SSH terminal using my phone?

From: Akexorcist
Sent: Monday, November 24, 2014 9:21 AM
To: akexorcist/Android-BluetoothSPPLibrary
Cc: Cherrie Mae Dinoy
Subject: Re: [Android-BluetoothSPPLibrary] Data received error (#2)

Don't worry about data format. It's depending on target device. Just try it.


Reply to this email directly or view it on GitHub.

from bluetoothspplibrary.

sushic avatar sushic commented on June 21, 2024

Using Android-BluetoothSPPLibrary, that's the biggest mistake we made. ;-)

from bluetoothspplibrary.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.