Coder Social home page Coder Social logo

blue2serial's People

Contributors

fcouceiro avatar macroyau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

blue2serial's Issues

bluetoothSerial.write not working when called from extended class

Hello,

I have my function in MainActivity:

public void send(String value) { String send = value.trim(); if (send.length() > 0) { try { bluetoothSerial.write(send); } catch(Exception e) { e.printStackTrace(); } } }

It's sending well when I call it from this MainActivity.
But, when I call it from my class "LaunchGame" (which is an extended class of MainActivity), it's sending nothing and I have no error...

Someone already had this kind of error ?

Set Buadrate

Is there are ways to set different Baudrates?

My App works with 115200 but if i change the baudrate on my BT Datalogger, my App cant communicate anymore.

Show scanned devices?

Hello

This works perfectly if i wanna connect to a paired device. How can i show results new (scanned) devices and conntect to them.

In your example code I found only paired soulution

Wrong cast if received Byte is bigger than 127

Hello Guys, great work you done.

We had for last Days some trouble with this API. Its exactly Issue#9. You wrote that you fixed it but it was not fixed.

Problem: If our App recieve byte 128 (hax 80), this lib read it as -128 and wrong hex.

We all know this happen because of signed Bytes in Java.

Workaround: SPPService.java
Replace this:
mHandler.obtainMessage(BluetoothSerial.MESSAGE_READ, bytes, -1, read.getBytes()).sendToTarget();

with this

mHandler.obtainMessage(BluetoothSerial.MESSAGE_READ, bytes, -1, read.getBytes(StandardCharsets.US_ASCII)).sendToTarget();

If you do this changes, issue like #9 never happen again. In most of usecases with SPP we think US_ASCII as default is much better....

Great work keep on.

Disconnect

Connection got disconnect when app is in background and do not reconnect when resumed again.

Broken Strings

First of all, thanks for developing this.

I was testing your app with a bluetooth barcode scanner in SPP profile. Unfortunately, it keeps breaking the string up in arbitrary parts. Usually the first few characters will be considered a different message than the rest of the barcode.

Do you know of why this might be?

Connecting to multiple bluetooth devices

Hi, can this be used to connect to multiple devices? I am doing a school project and need this info urgently. I tried with no success. Can anyone give me some sample code on how to do this?

Thanks in advance!

Unfortunately, Blue2Serial has stoped

Once I upload it in the tablet or android phone then it pops up a dialogue box on the tablet or phone says " Unfortunately, Blue2Serial has stopped". I attached the output log.
It was working before, but I think once Android Studio asked to upgrade, then it's happened after upgrading!
ScreenShot.pdf
Please help me to find the issue.

onBluetoothSerialWrite & onBluetoothSerialRead - return byte[]?

Hello.

Great library btw. I don't want to modify your library, I like using it with gradle.
Can you please make an update so that onBluetoothSerialWrite and onBluetoothSerialRead have a byte[] parameter, instead of String?

It would help me a lot. I am using bytes processing and by converting them from String some of the bytes get messed up.

Thank you.
I think something needs to be changed here:

                case MESSAGE_WRITE:
                    byte[] bufferWrite = (byte[]) msg.obj;
                    String messageWrite = new String(bufferWrite);
                    mListener.onBluetoothSerialWrite(messageWrite);
                    break;
                case MESSAGE_READ:
                    byte[] bufferRead = (byte[]) msg.obj;
                    String messageRead = new String(bufferRead);
                    mListener.onBluetoothSerialRead(messageRead);
                    break;

This is in BluetoothSerial.java

Can I use this to connect two Android phones

Hi
I'm trying to use this library and example app to connect two paired Android phones. But each time I click on "Connect" it just goes "Connecting..." and then "Disconnected"
Is it possible to connect between two Android phone using this library?

Bytes greater than 127

Once I send the bytes with value of 128 to 255 by Bluetooth to Android then I see different bytes. I receive -17, -65, -67 instead of 128 to 255. But, it works with 0 to 127. Something happens to "(byte[]) msg.obj" with negative values in the
private final Handler mHandler = new Handler()
in the section
case MESSAGE_READ:
byte[] bufferRead = (byte[]) msg.obj;

Would you please resolve it?
Best regards
Hamid Naghizadeh

Error Importing it to Android Studio

This project has some outdated libraries and some reference errors. At first I change the build.gradle script for the latest libraries that one of them was 'com.afollestad:material-dialogs' and the script had no problems but then a ListCallback error was found while compiling. The error was the following:

  • Error:(124, 17) error: method adapter in class Builder cannot be applied to given types;
    required: ListAdapter,ListCallback
    found: BluetoothDeviceListItemAdapter
    reason: actual and formal argument lists differ in length

I tried few things like calling the class builder by reference or creating a local object of the function but due to my inexperienced skills I was unable to resolve the root of the problem. Has the author or anyone have some plans to update this project?

Reading just parts of the barcode

Hi,

I have a bluetooth barcode reader and have connected it to my app using Blue2Serial. When I scan it and read the message String from onBluetoothSerialRead(), not every time I get the whole number.

Suppose the bar code is "MN000012HA". Sometimes when I scan I get "MN". Sometimes "00012" and sometimes the right number.

Can anyone please help me with that? I have configured the barcode reader to SPP mode.

Thanks

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.