Menu

make library without server-ports under linux

vogel
2013-05-10
2013-09-20
  • vogel

    vogel - 2013-05-10

    Hello,

    i have made the library to libbacnet.a with the command "make"
    I just want to use it for my client programm(write & read property), But i have noticed that the memory space is so huge!So:

    how can i make the libbacnet.a just contains the client functions?

    thx

     
  • Steve Karg

    Steve Karg - 2013-05-10

    All BACnet clients must still support the server portion (ReadProperty and Device object). The small clinets can use demo/object/device-client.c instead of device.c (see example Makefile used for command line clients).

    The resulting application will only include the binary chunks of libbacnet.a that it needs, and not include chunks it does not need, so it doesn't matter how many chunks are included in libbacnet.a file. The chunks in the library can be ignored if there is a object file included in the build before the library is added to the build, and this is how device-client.c works.

    There are places in code where static memory was allocated (via array) versus allocated from the heap as needed. If you want to have much lower initial memory, you would need to change all the places which used fixed size arrays for memory and convert to flexible allocated memory as needed.

     
  • vogel

    vogel - 2013-05-11

    Hello Steve,

    thx for your rapid reply!the device-client.c may be the solution for me. I need not to change the static-memory-allocated.
    I made the libbacnet.a myself by default using "make clean all", and then in my c++ linked it, i just want to realize the readprop function, how can i use the device-client.c? The file sould be in libbacnet.a?
    as the demo/readprop/makefile i saw the source code is
    SRCS = main.c \ ../object/device-client.c

    but in my app i wrote the same and link -lbacnet, the result is nothing changed!The target file is successful but also huge.(may contains all the AI,AO,BO,BI points, i guess)

     
  • Steve Karg

    Steve Karg - 2013-09-20

    The device-client.c functions should have replaced any similarly named functions in libbacnet.a file during linking.

    I modified the lib/Makefile and removed the example server objects and device.c, and only included the device-client.c in the library for building all the client examples. I modified the demo/server/Makefile to have all the example server objects and device.c so it builds correctly. Both Makefile can be retrieved from SVN trunk/bacnet-stack or from snapshot.

     

Log in to post a comment.