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

BLE Test from PC

Dear all

is there any possibility to use PC to test the nrf51822, Instead of Android/ios app?

preferably a lib to be used with Java, so one can have some test cases.

What am I trying to do?

I'd like to test the firmware locally with my PC before sending a tag to develop Android/ios app. But is seems that BLE library for java is not available (for pc at least).

There are some solutions like:

  • lib for pyton
  • masteremulator.dll , but it is a C++ lib so I cannot access it via JNA
  • tx/rx lib, but it is a low level interface, that will send/receive byte buffers.

anyone having the same "problem" .

Thank you OL

EDIT: more precisely I'm searching a GATT Server Library

Parents Reply Children
  • thank you Ole, I have tried to load MasterEmulator in Java via JNA, but there are callbacks and structures which is not a trivial job to port.

    In case you have an ANSI-C version of MasterEmulator :-) that would be awesome !

  • I was afraid complexity of the DLL might make that difficult, yes... Unfortunately, I don't yet have anything like that.

    The only option I can think of, if you're feeling adventurous, is to try to implement something by doing raw HCI commands from Java, directly to the serial port exposed by the Master Emulator firmware. This would however be completely unsupported: I can't help with the exact commands or responses, and things may break with future versions, with you getting to keep both pieces. You'd therefore have to reverse-engineer the protocol MCP uses to talk to the dongle by looking at the messages in its log file, and try to recreate those in your own Java application. But if you only need specific scenarios, and you only want to verify that those keep working with future firmware versions, that may actually be doable...

  • let me try with c# and .dll first :-) the HCI interface would be an option as I would probably need only a subset of commands. But, again it is time, and the fact that it will not be supported makes it priority 2.

    thank you for your support!

    I'll text updates on this topic.

  • I think I like the Master Emulator APIs :-) awesome and straightforward...

  • I'm trying to enumerate usb, and it hands there... the log says:

    6;00:20:17.5944 [MainThread] Initialize MasterEmulator, Version=2.1.7.8226, Culture=neutral, PublicKeyToken=null 7;00:20:17.7534 [MainThread] SerialNumberToComport called with serial number: 480105xxx 8;00:20:17.7534 [MainThread] Opening SYSTEM\CurrentControlSet\Enum\USB\VID_1366&PID_0101 9;00:20:17.7534 [MainThread] Opening SYSTEM\CurrentControlSet\Enum\USB\VID_1366&PID_0105 10;00:20:17.7534 [MainThread] Contains this serialNumber: path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_1366&PID_0105\000480105xxx 11;00:20:17.7534 [MainThread] A security error has been detected. 12;00:20:17.7534 [MainThread] Error accessing key. Skipping. 13;00:20:17.7534 [MainThread] SerialNumberToComport for serial 480105xxx returned .

    am I missing some security setup?

    when running precompiled demo, the log is good:

    ;00:01:05.8775 [MainThread] Initialize MasterEmulator, Version=2.1.7.8226, Culture=neutral, PublicKeyToken=null 1;00:01:06.0345 [MainThread] SerialNumberToComport for serial 480105xxx returned COM12.

Related