0

Does anyone have experience using the Nordic NRF52840 with a C# app to act as a receiver?

I'm trying to communicate with an Onset InTemp thermometer and although I've had quite a bit of success with the native Windows 10 BLE, I'm having some problems. See: C#, BLE. Why does GetGattServicesAsync hang forever? Is there a work around such as turning off/on BLE? for details.

Nordic advertises that they only have C++, Python and Node.js libraries. See https://devzone.nordicsemi.com/f/nordic-q-a/65516/using-nrf52840-dongle-as-receiver-client-for-onset-thermometer for example. I need either a C# library OR perhaps some hints on how to build the C++ library with Visual Studio (there are no instructions that I can see) and setup the interop layer (method signature etc.). I think this would go much faster if I saw an example :). And I'm guessing this type of work has been done before.

Another possibility is to call the Node.js libraries from C# which I understand is possible but again, I'd need some initial examples. Probably more so as I've never used Node.js either on its own or from C#.

Thanks, Dave

Dave
  • 8,095
  • 14
  • 56
  • 99
  • 1
    Why not use C++ version from C#? I'm no expert, but that seems like the closest compatibility. – l3l_aze Sep 09 '20 at 21:54
  • Thanks https://stackoverflow.com/users/7665043/l3l-aze. That's probably what I'll do, but it would be nice if there were some examples to look at. As I recall from limited P/Invoke and Interop experience, there are method signatures and the like to write. Plus there is the problem of actually compiling the C++ code. Thanks for reading. – Dave Sep 10 '20 at 13:36
  • Excellent point; I'm not deep into the C family personally as it's too difficult past "the basics", and I hadn't considered that. There are open source Node and Python bindings that would help towards a library but that would greatly delay progress on your desired project and require upkeep over time. [This answer](https://stackoverflow.com/q/15136952/7665043) has some ideas for using Node and C# together. Node is not very different from JS and since you're already used to C#'s modularized style it may be easier than going from learning JS right to Node. – l3l_aze Sep 10 '20 at 17:00
  • Also, NordicSemi and their code are on GitHub, and the [readme for the driver](https://github.com/NordicSemiconductor/pc-ble-driver) has short compilation instructions that mention VS by name, so it should be pretty simple. – l3l_aze Sep 10 '20 at 17:09

0 Answers0