This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Master Emulator go crazy after a connect fail

Hi,

I'm using the Master Emulator DLL to build a VB, everything seems go fine. However I found that if there's a device discovered but fail to connect by some result (eg. if the device just shut off the BLE; or if it's too far away). Once connection failed, it cannot start device discovery again. Whenever I start discovery after such condition, the masterEmulator.StartDeviceDiscovery will also return FALSE. The only thing I can do is quite the program and re-start it.

I can also repeat the problem by NetworkAvailabilityDemo example code.

So, is there anyway I can do to "recover" such condition?

I'm using the latest DLL (2.1.13.14), x86 version, using the PCA10031 dongle.

My code about the discovery is:


'Start discovery
Public Sub startDeviceDiscovery()
    Dim scanPara As BtScanParameters = New BtScanParameters
    scanPara.ScanType = BtScanType.ActiveScanning

    If Not g.masterEmulator.IsDeviceDiscoveryOngoing Then
        g.masterEmulator.StartDeviceDiscovery(scanPara)
    End If

    g.isBusy = False
    MainForm.updateUI()

End Sub
Related