|
From: | address@hidden |
Subject: | Re: [lwip-users] REST API on microcontroller with lwIP |
Date: | Mon, 1 Feb 2021 20:16:21 +0100 |
User-agent: | Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 |
Am 01.02.2021 um 18:14 schrieb Marco Giammarini: > You meanĀ genfiles_example > <https://git.savannah.nongnu.org/cgit/lwip/lwip-contrib.git/tree/examples/httpd/genfiles_example>/genfiles_example.c > <https://git.savannah.nongnu.org/cgit/lwip/lwip-contrib.git/tree/examples/httpd/genfiles_example/genfiles_example.c>? > But, how can I use this code with CGI reply? Have you actually had a look at the code? Did you see the comment in line 109? /* instead of doing memcpy, you would generate e.g. a JSON here */ https://github.com/lwip-tcpip/lwip/blob/12b45506dd667a05aa198f0592625901e54267bc/contrib/examples/httpd/genfiles_example/genfiles_example.c#L109 Just create your response there instead of doing a memcpy and you should be good. Regards, Simon
[Prev in Thread] | Current Thread | [Next in Thread] |