Problems working with Bluetooth/BLE

Ask, and ye shall receive.
cmag
Posts: 2
Joined: 11:07, 13 Jul 2015

Problems working with Bluetooth/BLE

Postby cmag » 11:14, 19 Oct 2015

I have an app that works fine with Android and Evothings 1.2.
I wanted to test it under iOS; with Evothings 1.2 I have a problem with bluetoothSerial.list: it seems that bluetoothSerial is undefined.
With Evothings 2.0.0 Alpha 3, everything seems to still work fine with Android.
With iOS in the following code:

Code: Select all

   
    console.log("START SCAN");
    evothings.ble.startScan(
        function(device) {
            var info;
            if (device.scanRecord) { // NOT on IOS
                console.log("ANDROID SCAN CALLBACK");
                info=app.util.extractAdvertData(atob(device.scanRecord));               
            }
            else if (device.advertisementData) { // ONLY on IOS   
                console.log("IOS SCAN CALLBACK");
                info=app.util.extractAdvertDataIOS(device.advertisementData);
            }
            else { 
                console.log("UNKNOWN SCAN CALLBACK");
            }

The callback is never called; the console log displays:
LOG: Error in Success callbackId: BLE1050944742 : Error: InvalidCharacterError: DOM Exception 5
And on the device I get i dialog saying:
Error in cordova.js : line #307
Invalid character error: DOM exception 5
An invalid or illegal character was specified such as in an XML name

Fredrik
Site Admin
Posts: 196
Joined: 15:00, 18 Nov 2013

Re: Problems working with Bluetooth/BLE

Postby Fredrik » 11:27, 19 Oct 2015

Please try our example "ble-scan". Does it give a similar error? If so, I would guess that you have a strange BLE device nearby, that sends data that cannot be correctly parsed by our plugin.


Return to “Questions and answers”

Who is online

Users browsing this forum: MSN [Bot] and 2 guests