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

C# PC app development with nRF52840-dongle

Our purpose is to integrate BLE 5 in our embedded application, and do it quickly.. We basically need to send/receive data with maximum throughput. 

Per thread below, we are planning to use the ble_app_uart on the embedded side.

For developing the PC app side, assume we are using the nRF52840-dongle you recommended in thread below, where can I find a code example in C# for doing this, implementing the NUS profile? I see there is JS/Node.js code of nrf-connect, but this is somewhat distant from our .NET environment.

Also i see in the Android app - nRF Toolbox - there is a UART app. So basically I'm looking for an equivalent C#/Windows code sample.

Does the pc-ble-driver in C++ cover the NUS service?

Spun off from:

Getting started with MBN52832 BLE Module

Parents
  • Hi,

    For developing the PC app side, assume we are using the nRF52840-dongle you recommended in thread below, where can I find a code example in C# for doing this, implementing the NUS profile? I see there is JS/Node.js code of nrf-connect, but this is somewhat distant from our .NET environment.

    Nordic does not provide any C# bindings for the pc-ble-driver, unfortunately. We only supply is the pc-ble-driver (C++) and JS and Python bindings.

    Does the pc-ble-driver in C++ cover the NUS service?

    No. The pc-ble-driver itself just provides the PC side of the SoftDevice API, and it does not incorporate any functionality that is not part of the SoftDevice. That means that you need to implement services yourself, as well as other higher-level functionality if needed (such as bond management, equivalently to what the peer manager library does in the SDK).

    Lastly, please note that if you need high throughput, it might be better to use a natively supported Bluetooth device on the PC side rather than the nRF52840 dongle, since the pc-ble-driver and the rest of the SoftDevice serialization system introduces a significant overhead that reduces the throughput. (The nRF52840 is a good development tool though, when used together with the nRF Connect for Desktop BLE app or nRF Sniffer.)

  • Thanks Einar. What do mean by "a natively supported Bluetooth device on the PC side"? Can you give an example of such a device? 

  • Thanks Einar!! it is working for me now! I am receiving notifications from the HRM! You made my weekend :)

  • Hi Einar, I am now trying to modify the HRM app for achieving max throughput test. I set the HRM timer to send notification every 100ms (instead of 1000ms), and tried to send 244 bytes instead of only 2 bytes, per measurement. I can actually see the data is sent when checking on nRF Connect on my Android phone log. But the pc-ble-driver is only receiving 20 bytes out of this. Where do I need to change the pc-ble-driver to receive all data? Am I going the right way here for a throughput test? I also tried to set a bigger MTU size by setting BLE_GATT_ATT_MTU_DEFAULT to 244, but this failed. What about the connection-interval? Please comment on these.

  • I changed some parameters in the HRM apps on both sides and reach 10KBps. This is still low. We are expecting over 100KBps. You said the throughput would be reduced due to pc-ble-driver. What throughput should we expect? Please respond. We are in POC phase and need to know if we can use this solution. 

  • Hi,

    The most important for increasing throughput using the pc-ble-driver is increasing the ATT MTU. However, the pc-ble-driver has significant overhead due to the serialization and all packets being backed on the UART/USB transport, so you will not get very high throughput.

Reply Children
Related