Name |
Date |
Size |
#Lines |
LOC |
||
---|---|---|---|---|---|---|
.. | - | - | ||||
.gitignore | D | 12-May-2024 | 128 | 8 | 6 | |
Makefile | D | 12-May-2024 | 2.5 KiB | 70 | 37 | |
README | D | 12-May-2024 | 964 | 31 | 21 | |
coap_config.h | D | 12-May-2024 | 963 | 43 | 19 | |
lwipopts.h | D | 12-May-2024 | 926 | 38 | 20 | |
server-coap.c | D | 12-May-2024 | 4.2 KiB | 148 | 98 | |
server-coap.h | D | 12-May-2024 | 412 | 18 | 4 | |
server.c | D | 12-May-2024 | 3 KiB | 92 | 32 |
README
1Example of libcoap running on lwIP 2================================== 3 4To run the example, do 5 6 $ make 7 $ sudo ./server 8 9(and in a second terminal) 10 11 $ sudo ip a a dev tap0 192.168.113.1/24 12 13and query `coap://192.168.113.2/time?ticks` with any coap tool, 14or query `coap://[aaaa::1000]/.well-known/core` 15 16This will 17 18* download lwip and lwip-contrib from the upstream git sources 19* build the server application 20* run the server application, creating a virtual network device tap0 (unless 21 that exists) 22* configure your network interface to make the server accessible. 23 24* return the appropriate response from the server to the client. 25 26The server creates a resource for 'time' with a query 'ticks'. This is 27reported for `.well-known/core`. The work flow for adding more resources does 28not differ from regular libcoap usage. If you seem to run out of memory 29creating the resources, tweak the number of pre-allocated resources 30in `include/coap/lwippools.h`. 31