JorgeGzm opened a new pull request, #19482:
URL: https://github.com/apache/nuttx/pull/19482

   ## Summary
   
   Add a `curl` configuration for the `linum-stm32h753bi` board, based on the
   `netnsh` configuration (Ethernet + DHCP). It enables the `system/curl` HTTP
   client command, SD card support (mounted manually, as in the `sdcard`
   configuration) and a larger console line buffer (`CONFIG_LINE_MAX=256`) so 
long
   URLs and JSON bodies are not truncated at the NSH prompt.
   
   Also document the curl command:
   - a man page under `Documentation/applications/system/curl/`
   - a usage example (download, POST JSON, multipart upload) in the board docs
   
   Companion PR (the command itself): 
https://github.com/apache/nuttx-apps/pull/3651
   
   ## Impact
   
   - New board configuration `linum-stm32h753bi:curl`; no existing 
configuration is
     changed.
   - Otherwise documentation only (one new man page + a board-docs example).
   
   ## Testing
   
   - **Build Host:** Linux, `arm-none-eabi-gcc`
   - **Target:** `linum-stm32h753bi:curl`, flashed on hardware (STM32H753BI, 
Ethernet + microSD)
   
   ```
   nsh> mount -t vfat /dev/mmcsd0 /mnt
   nsh> ifconfig
   eth0    Link encap:Ethernet HWaddr 00:e0:de:ad:be:ef at RUNNING mtu 1486
           inet addr:192.168.15.3 DRaddr:192.168.15.1 Mask:255.255.255.0
   
   Download to SD (-o) — text, binary and image, all HTTP 200:
   nsh> curl -o /mnt/dl.json http://httpbin.org/json
   curl: HTTP 200
   nsh> curl -o /mnt/1kb.bin http://httpbin.org/bytes/1024
   curl: HTTP 200
   nsh> curl -o /mnt/img.png http://httpbin.org/image/png
   curl: HTTP 200
   nsh> ls -l /mnt/1kb.bin /mnt/img.png
    -rw-rw-rw-        1024 /mnt/1kb.bin
    -rw-rw-rw-        8090 /mnt/img.png
   
   POST JSON echoed back by httpbin:
   nsh> curl -H Content-Type:application/json -d '{"temp":25.3,"hum":60}' 
http://httpbin.org/post
   {
     "json": { "hum": 60, "temp": 25.3 },
     "url": "http://httpbin.org/post";
   }
   curl: HTTP 200
   
   Multipart image upload + download back (byte-identical round-trip):
   nsh> curl -F file=@/mnt/nuttx_logo.png 
"http://192.168.15.12:8000/api/.../ota/upload?version=logo1";
   {"filename":"nuttx_logo.png","sha256":"ca278dcb...","size_bytes":40343}curl: 
HTTP 201
   nsh> curl -o /mnt/logo_back.png 
http://192.168.15.12:8000/api/.../ota/default/logo1/nuttx_logo.png
   curl: HTTP 200
   nsh> ls -l /mnt
    -rw-rw-rw-       40343 nuttx_logo.png
    -rw-rw-rw-       40343 logo_back.png
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to