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

BLE masteremulator.dll - Problem with masteremulator. bond() method

Hi,

I have been experimenting with the master emulator .dll - I started with the HidDemo project which is written in C#. This seems to work perfectly well.

I have rewritten ( translated ?) the demo code into VB.NET ( Visual Studio Express 2010). Everything seems to be ok until I try to call masteremulator.bond(securityparameters). In my version this fails. As far as I can see the security parameters I am sending to the method are the same as those sent by the HidDemo bond function.

I have attached a word document with both sets of code and the securityparameters exposed. I have also attached attached the log that the masteremulator dll has churned out (sorry it is in verbose mode).

I fully expect to find that I am missing something glaringly obvious, but for the moment I can see the wood for the trees! :)

Thanks in advance to anyone who can spot the problem.

Regards

Godric

master_emulator_log.txt

Parents
  • HidDemo.sln (C#)

    void Bond() { SecurityParameters securityParams = new SecurityParameters(); securityParams.IoCapabilities = IoCapabilitiesEnum.KeyboardDisplay; securityParams.OobAvailability = OobAvailibilityEnum.OobNotAvailable; bool bondSuccess = masterEmulator.Bond(securityParams); if (!bondSuccess) { throw new Exception("Bonding failed."); } }

    BLETrial.sln VB Public Function Bond() As Boolean

        Dim securityParams As New Nordicsemi.SecurityParameters
        Dim bondSuccess As Boolean = False
    
        securityParams.IoCapabilities = IoCapabilitiesEnum.KeyboardDisplay
        securityParams.OobAvailability = OobAvailibilityEnum.OobNotAvailable
        bondSuccess = masteremulator.Bond(securityParams)
        If Not (bondSuccess) Then
    
            frmErrorMessage.txtClassName.Text = classname
            frmErrorMessage.txtVersion.Text = version
            frmErrorMessage.txtSystemMessage.Text = ""
            frmErrorMessage.txtApplicationMessages.Text = "Bond() - Bonding Failed"
    
        End If
        Return bondSuccess
    
    End Function
    
Reply
  • HidDemo.sln (C#)

    void Bond() { SecurityParameters securityParams = new SecurityParameters(); securityParams.IoCapabilities = IoCapabilitiesEnum.KeyboardDisplay; securityParams.OobAvailability = OobAvailibilityEnum.OobNotAvailable; bool bondSuccess = masterEmulator.Bond(securityParams); if (!bondSuccess) { throw new Exception("Bonding failed."); } }

    BLETrial.sln VB Public Function Bond() As Boolean

        Dim securityParams As New Nordicsemi.SecurityParameters
        Dim bondSuccess As Boolean = False
    
        securityParams.IoCapabilities = IoCapabilitiesEnum.KeyboardDisplay
        securityParams.OobAvailability = OobAvailibilityEnum.OobNotAvailable
        bondSuccess = masteremulator.Bond(securityParams)
        If Not (bondSuccess) Then
    
            frmErrorMessage.txtClassName.Text = classname
            frmErrorMessage.txtVersion.Text = version
            frmErrorMessage.txtSystemMessage.Text = ""
            frmErrorMessage.txtApplicationMessages.Text = "Bond() - Bonding Failed"
    
        End If
        Return bondSuccess
    
    End Function
    
Children
No Data
Related