Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth Serial plugin device disconnect is not firing error callback #154

Closed
WHarris22 opened this issue May 6, 2016 · 1 comment
Closed

Comments

@WHarris22
Copy link

WHarris22 commented May 6, 2016

I have some code which connects to a Bluetooth device which works as expected but when the device disconnects the error callback does not get called.

Here is the code I am using...

BluetoothSerial.connect(device.id).then((response) => {
                            console.log('bluetooth serial success callback: ' + response);
                            //this._successCallback(response);
                        }, (err) => {
                            console.log('bluetooth serial error callback: ' + err);
                            //this._errorCallback(err);
                        });

I'd like to add that the error callback does get called when there is an error attempting to connect to a device, it just doesn't seem to get called when a connection disconnects.

Is there any reason for this?

@WHarris22 WHarris22 changed the title Bluetooth serial device disconnect is not firing error callback Bluetooth Serial plugin device disconnect is not firing error callback May 6, 2016
@ihadeed
Copy link
Collaborator

ihadeed commented May 8, 2016

Thanks @WHarris22 for opening this issue.

We will probably have to change the return type of the connect function to be an Observable instead of a Promise. That should solve the issue. Will fix in next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants