0

I'm working on a custom Linux BACNet compatible device. I've stopped my search on BACNet Stack.

I've been able to build from the latest version on github, also been able to test both readprop and writeprop with server from the build directory (examples provided). I had to edit the writeprop to make it properly work, but this is not the point here.

Now, I'm wondering what is the good way to implement a device that will answer to read-property requests. In the server example, there is one handler that could be the way :

    apdu_set_confirmed_handler(
    SERVICE_CONFIRMED_READ_PROPERTY, handler_read_property);

but I'm confused when I go into source of h_rp.c I see the function Device_Read_Property is called, which make more sense to overload? This function seems to belong to device.h.

So, should I overload Device_Read_Property ? Seems like the library is missing a device implementation comprehensive example.

Alexandre Lavoie
  • 8,711
  • 3
  • 31
  • 72
  • I can't comment on BACStack directly, but I do wonder if either a C# or NodeJS if not Java library might be slightly slicker to work with; are you tied to using 'C' as your language of choice? – DennisVM-D2i Sep 15 '22 at 17:07
  • @DennisVM-D2i, well my project is in C++, I don't mind using a C library, but it's not just clear what is the good way to integrate the "server" part into an application. – Alexandre Lavoie Sep 15 '22 at 17:24
  • What' I'm trying to say is that the other libraries might be quicker if not possibly easier to work with - at least in terms of getting a device working quicker. – DennisVM-D2i Sep 22 '22 at 16:05
  • @DennisVM-D2i Yes that's what I understood, but the C++ application I want to add BACNet support is already developped and won't be migrated to another language. – Alexandre Lavoie Sep 22 '22 at 17:56
  • As much as you could wrap it with CLR+ (/.NET's managed C++ for C# integration), the better approach might be via a HTTPS web-API/web-service or direct via BACnet/IP; so you could mock something up quickly, with say NodeJS & the 'bacstack' package, to buy you time to figure out the BACnetStack equivalent in the background. YABE as a demo server with it. – DennisVM-D2i Sep 22 '22 at 18:19
  • @DennisVM-D2i For me, having another platform will only add more work on future maintenance. – Alexandre Lavoie Sep 22 '22 at 20:50
  • It wasn't about trying to provide you a replacement platform, it was more about giving you a quick alternative sample, that you might learn & (for a short while) benefit from, to just possibly allow you to better diagnose/see the issue with your own code; e.g. for example, a working NodeJS sample can be working (in a very basic way) in minutes. ;) – DennisVM-D2i Oct 21 '22 at 18:09

0 Answers0