echo_client and echo_server run in the same board


Diana Rivera
 

Hello,

I am currently trying to run an nrf52 board as both client and server at the same time (based on echo_client and echo_server samples). I've gone through their configuration files, and have found that CONFIG_NET_APP_CLIENT=y is enabled in the client, and CONFIG_NET_APP_SERVER=y is enabled in the server. According to Zephyr's documentation, this configurations need to be set to "y" to enable the respective client and server's net app library APIs.
However, when enabling both CONFIG_NET_APP_SERVER=y and CONFIG_NET_APP_CLIENT=y, the following errors appear:

In function ‘close_net_ctx’:
/home/user/zephyr/subsys/net/lib/app/client.c:279:19: error: ‘struct <anonymous>’ has no member named ‘net_ctxs’
    if (ctx->server.net_ctxs[i]) {
                   ^
/home/user/zephyr/subsys/net/lib/app/client.c:280:32: error: ‘struct <anonymous>’ has no member named ‘net_ctxs’
     net_context_put(ctx->server.net_ctxs[i]);
                                ^
/home/user/zephyr/subsys/net/lib/app/client.c:281:16: error: ‘struct <anonymous>’ has no member named ‘net_ctxs’
     ctx->server.net_ctxs[i] = NULL;

Is it impossible to run both client and server in the same board at the same time? or is there a way to get around this problem?
I was thinking on running the client in a thread, and the server in another thread, but that would still imply having both CONFIG_NET_APP_SERVER=y and CONFIG_NET_APP_CLIENT=y enabled in the prj.conf file.

Thank you in advance for your help.

Best regards,
Diana 

Join devel@lists.zephyrproject.org to automatically receive all group messages.