This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Use of certain libraries in Coap_Client sample in nRF_Connect_SDK

Hi,

In Openthread's  Coap_client  sample, Following 2 libraries are there:

#include <net/net_l2.h>
#include <net/net_pkt.h>

and while compiling my code I get multiple warning regarding to above 2 libraries.

Following are some such warnings:

zephyr/include/net/capture.h:51:14: warning: 'struct net_pkt' declared inside parameter list will not be visible outside of this definition or declaration
   51 |       struct net_pkt *pkt);
      |              ^~~~~~~
zephyr/include/net/capture.h:180:15: warning: 'struct net_pkt' declared inside parameter list will not be visible outside of this definition or declaration
  180 |        struct net_pkt *pkt)
      |               ^~~~~~~
zephyr/include/net/capture.h:208:65: warning: 'struct net_pkt' declared inside parameter list will not be visible outside of this definition or declaration
  208 | static inline void net_capture_pkt(struct net_if *iface, struct net_pkt *pkt)

So can you explain me the use of these 2 libraries, what feature do they support, can I remove them If I don't require that feature?

  • Hi,

    Which nRF Connect SDK version are you using? And which changes have you made to the sample? I aske because the two includes (net/net_l2.h and net/net_pkt.h) are not used in the coap_client sample in 1.9.1. They are used in the coap_server sample though, but I do not get these warnings even then.

    So can you explain me the use of these 2 libraries, what feature do they support, can I remove them If I don't require that feature?

    I need to know more about your app to say if they are needed. That said, I you an remove the include and if everything builds OK that indicates that they are not used. If not, then they are used and it needs to be looked more into.

  • I removed these libraries and didn't face any issues in the build. So  I guess these are not used anywhere.

    I am currently using version 1.8.0. So can you tell me in brief about all imp features of V1.9.1 and should I move to SDK V1.9.1 before completing my application development?

  • Hi,

    I am not able to find net/net_pkt.h or net/net_l2.h included in the coap_client in 1.8 either, perhaps you added them yourself by accident and forgot about it? In any case, they are not used in the example and can be safely removed.

    You can read about the most important changes in the release notes for 1.9.0 and 1.9.1. If you should migrate or not is application specific, and also depends on how far you have come with your development. If you are not yet close to going to production, and migration is simple (which I expect will be the case for most application migrating from 1.8 to 1.9), then migrating to the newest available SDK normally makes sense.

  • Hi,

    Thanks for the update.

    Yes you are right that net/net_pkt.h or net/net_l2.h are not included in the coap_client in 1.8 either. 

    But why I had these files is because my node is using 2-way communication with edge and I have merged both coap_client and coap_server functionality in a single node.

    So by default, I added all include files of both applications.

    So is there any specific use of these files in the coap_server sample? 

  • Ah, I see. Checking in 1.9 at least, the two header files are not used in the coap_server sample either, even though it is included in ot_coap_utils.c. So it is safe to remove the two include statements.

Related