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 Reply Children
  • Hi,

    This is the correct place to get pc-ble-driver support (and support for any other nRF product). The error you are seeing match what you see when you use incompatible pc-ble-driver API version and connectivity firmware API version.

    Which exact hex file and which exact example file did you try? Just to make sure the basics are working I suggest the following:

    • Build the heart_rate_collector examples (using VisualStudio all variants are built in one go)
    • Run the nRF Connect BLE app to make sure you have a working connectivity firmware (this will be API version 3).
    • Run the API version 3 heart rate collector example like this (replacing the COM port with your number: ".\heart_rate_collector_sd_api_v3.exe COM6"

    Then you should see an output similar to this:

    λ .\heart_rate_collector_sd_api_v3.exe COM6
    Serial port used: COM6
    Baud rate used: 1000000
    Info: Successfully opened COM6. Baud rate: 1000000. Flow control: none. Parity: none.
    Status: 6, message: Target Reset performed
    Status: 7, message: Connection active
    Scan started
    Received advertisement report with device address: 0xF333BF1473AB
    Received advertisement report with device address: 0x6A8691EE9176
    Received advertisement report with device address: 0xF333723ED24C
    Received advertisement report with device address: 0x66E795F64F45
    Received advertisement report with device address: 0xF333723ED24C
    Received advertisement report with device address: 0x0212DAE12FDF
    Received advertisement report with device address: 0x4A7357CC6E17
    Received advertisement report with device address: 0xF333723ED24C
    Received advertisement report with device address: 0x62F5E2A7602A
    Received advertisement report with device address: 0x0212DAE12FDF
    Received advertisement report with device address: 0xF333723ED24C
    Received advertisement report with device address: 0x6A8691EE9176
    Received advertisement report with device address: 0xF333BF1473AB
    Received advertisement report with device address: 0x0212DAE12FDF
    Received advertisement report with device address: 0xF33365117774

    You may not want to use the older API version, but if this works, then you know the basic setup is working. Then you can move on to trying a different API version and making sure you have programmed a corresponding connectivity firmware hex file.

  • I tried all of these and still the same. Can you state the exact hex file to use for the dongle? 

  • Hi,

    Let's say you are using the v5 API instead (I don't recomend v6, since we do not use it yet and do not test it), then you should use connectivity_4.1.1_usb_with_s132_5.1.0.hex. You can use the heart_rate_collector_sd_api_v5.exe example to see that it works.

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

Related