libcoap icon indicating copy to clipboard operation
libcoap copied to clipboard

Does libcoap with LwIP supports Client applications ?

Open fun-works opened this issue 5 years ago • 3 comments

fun-works avatar Jan 12 '21 06:01 fun-works

I don't see why it should not be able to do this. There currently is only a server example, and it should not be difficult to add a client example if someone wants to volunteer.

mrdeep1 avatar Jan 12 '21 11:01 mrdeep1

Hello Thanks for your time and work with this lib

--

may be "it should not be difficult to add a client example", but can you (@mrdeep1 or @obgm) help in this questions:

  • how to create client session with lwip, that will be equal to client in libcoap-minimal repo?
  • coap_io_lwip.c tested with coap client build?

what I try to do: coap_session_t *session = coap_new_client_session(ctx, &src, &dst, COAP_PROTO_UDP); -> coap_session_t *session = coap_session_create_client(ctx, local_if, server, proto); -> and in line 823 of coap_session.c -> https://github.com/obgm/libcoap/blob/df9071c93efff2e648257314198268c7c1d79980/src/coap_session.c#L819

and next, in coap_io_lwip.c, in function coap_socket_connect_udp() https://github.com/obgm/libcoap/blob/df9071c93efff2e648257314198268c7c1d79980/src/coap_io_lwip.c#L193

finaly, I goto error; and session == NULL, and I'm here with the same problem as topic starter

--

sry for my english

Borodkov avatar Nov 18 '21 13:11 Borodkov

PR #884 has been raised which provides LwIP coap-client support.

mrdeep1 avatar Jul 23 '22 15:07 mrdeep1

Closed as fixed in https://github.com/obgm/libcoap/pull/926 which is now in the develop branch. Client support is now available.

mrdeep1 avatar Sep 22 '22 09:09 mrdeep1