-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding compiler options for enabling/disabling network layer #838
Comments
@jqiaobln There is a defined interface for the underlying read/write operations on the network. Ports for non-POSIX platforms show how to replace them. Data structures such as coap_address_t can be replaced to serve special needs as well. DTLS and TLS can be switched off (there is no point in abstracting these away because the supported DTLS and TLS libraries address very specific transport layer characteristics). |
@jqiaobln libcoap is now broken down into protocol layers, making it much easier to intercept at the level appropriate for your application. So, in your cited case, the Each layer function calls the next function in the protocol stack (when it has finished processing) with its level as an index - e.g. |
@mrdeep1 What if I don't have socket-style communication? The API in coap_netif.c Still seems to assume that I have network interfaces, addresses and sockets. It assumes that you need listen and connect. But what if I want to do point-to-point CoAP communication via e.g. UART? Is there a way to do that already? |
Interesting question. Simple answer is a bit of work is required. The support for AF_UNIX style sockets goes someway to what you are looking for as a starting model. libcoap relies on a socket structure So UART specific information can sit in If you look at So, you will need your UART read/write/establish/close functions defined that work for your UART. |
Furthermore, if you look at the socket specifics in |
Is your feature request related to a problem? Please describe.
Coap is a transport layer protocol. It should be fully functional without assumptions of underlying security and network layer.
Libcoap has options to compile without TLS libraries; however it always includes networking layer code, i.e. coap_io.c and address.c, etc.
Describe the solution you'd like
Libcoap will improve its reusability and modulization if there are compiler options which can enable/disable the network layer code.
E.g. a project whose TLS and networking layer are handled by some other libraries, can integrate libcoap without including coap_io.c, address.c and the system networking libraries: socket, tcp, etc.
The text was updated successfully, but these errors were encountered: