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

bluetoothSerial skips all functions #195

Closed
Frakcool opened this issue Jan 28, 2016 · 1 comment
Closed

bluetoothSerial skips all functions #195

Frakcool opened this issue Jan 28, 2016 · 1 comment

Comments

@Frakcool
Copy link

I've tried the following code:

var scanPorts = function() {
    if (deviceMode == 'serial') {
        chrome.serial.getDevices(onGetDevices);
    } else if (deviceMode == 'bluetooth') {
        bluetoothSerial.setDiscoverable(0);
        bluetoothSerial.readRSSI(
            function(rssi) {
                console.log(rssi);
            },
            function(error) {
                console.log('Error1');
            }
        );
        bluetoothSerial.list(
            function(devices) {
                devices.forEach(function(device) {
                    console.log(device.id);
                })
            },
            function(error) {
                console.log('Error2');
            }
        );
    }
}

But I get no output on the console, it enters the bluetooth section, and allows bluetooth to be visible for unlimited time, however on the next lines I don't get anything, I've added a breakpoint in every if but it never enters success / failure functions.

I'm using Cordova 5.4.1, over Mac OS El Capitan with this device (Verifone VX600), it's a Point Of Sale (POS) Device. I call the above function every 3 seconds, we're also using nwjs and from there we're trying to get this information. Do you have an idea what's going on?

@Frakcool Frakcool changed the title bluetoothSerial.list retrieves a blank list bluetoothSerial skips all functions Feb 3, 2016
@don
Copy link
Owner

don commented Mar 24, 2016

I'd try pairing the VX600 with an Android device, then using bluetoothSerial.list to find the device and bluetoothSerial.connect to connect to it.

The VX600 needs to support SPP for this to work.

Since it's a Bluetooth Classic device, it will only work Android with this plugin.

@don don closed this as completed Apr 20, 2016
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