Managing bluetooth connection

I am using BluetoothSerial in ionic 2. Upon listing devices (BluetoothSerial.list()), I am connecting to a device using BluetoothSerial.connect(MacID) which is a observable call.

The connection is success. When the device is out of range, I expect the connect call to return failure. However, it returns success still. Am I missing something ?

Code snippet below :slight_smile:

connectDevice(device) {

 BluetoothSerial.isConnected().then (
   res => {
    console.log("Bluetooth connection active" + "  " + JSON.stringify(res));
          },
  err => {
    console.error("Bluetooth connection not active", err);
    BluetoothSerial.connect(device.id).subscribe(
      res => {
        console.log("Connected" + "  " +JSON.stringify(res));
      },
      err => {
        console.log("Unable to connect" + "  " + err);
      }
    )
  }
 )

}

add this,
// prepare
import { ApplicationRef } from β€˜@angular/core’;
constructor(public applicationRef: ApplicationRef) { }

// add this code below when you want to refresh (I know it need in callback only)
this.applicationRef.tick();

hope to help you,
Regards,