void connect(final Context context, final ExtendedBluetoothDevice device, final boolean connectToNetwork) {
        mMeshNetworkLiveData.setNodeName(device.getName());
        mIsProvisioningComplete = false;
        mIsCompositionDataReceived = false;
        mIsDefaultTtlReceived = false;
        mIsAppKeyAddCompleted = false;
        mIsNetworkRetransmitSetCompleted = false;
        //clearExtendedMeshNode();
        final LogSession logSession = Logger.newSession(context, null, device.getAddress(), device.getName());
        mBleMeshManager.setLogger(logSession);
        initIsConnectedLiveData(connectToNetwork);
        mConnectionState.postValue("Connecting....");
        //Added a 1 second delay for connection, mostly to wait for a disconnection to complete before connecting, in case a device was previously connected.
        Log.d("AA", "Connect issued");
        mBleMeshManager.connect(device.getDevice()).retry(3, 200).enqueue();
    }
Connect to peripheral

@param context          Context
@param device           {@link ExtendedBluetoothDevice} device
@param connectToNetwork True if connecting to an unprovisioned node or proxy node
app/src/main/java/no/nordicsemi/android/nrfmesh/viewmodels/NrfMeshRepository.java