daniel-p-carvalho opened a new pull request, #3893:
URL: https://github.com/apache/nuttx-apps/pull/3893

   ## Summary
   
   Let the `wifibridge` command keep its configuration across resets. This is 
the follow-up to #3876, which left saving the SSID and the passphrase out.
   
   ```
   wifibridge save [-s <ssid>] [-p <passphrase>] [-c <channel>] [-3] [-a 
<ipaddr>] [-d|-D]
   wifibridge clear
   ```
   
   - `save` writes the SSID, the passphrase, the channel, the security, the 
bridge address and the DHCP server option. `start` then uses them instead of 
the Kconfig defaults, and the options given to `start` win for that run only. 
`clear` forgets them.
   - New `-D` option: do not run the DHCP server. With `-d` it lets one run 
override a saved choice either way, the last one on the command line wins.
   - The configuration is one record (magic number, version, CRC-32) at the 
start of `CONFIG_NETUTILS_WIFIBRIDGE_STORAGE`: a file of a file system mounted 
at boot, or a block device such as the MTD of a few pages of flash. A missing 
or damaged record is ignored and the defaults are used. The passphrase is 
stored as is.
   - `wifibridge_save()`, `wifibridge_load()` and `wifibridge_clear()` in 
`netutils/wifibridge`, behind `CONFIG_NETUTILS_WIFIBRIDGE_PERSIST` (default 
`n`). The SoftAP parameters are now checked in one place, also by `start` 
before anything is changed.
   
   The library is generic. On the EV49N51A the storage is the program flash 
exposed as an MTD by apache/nuttx#20788, which this PR needs on that board. 
Other boards only need a file system or a block device.
   
   ## Impact
   
   New, optional, default `n`. Without `CONFIG_NETUTILS_WIFIBRIDGE_PERSIST` 
nothing changes, except that `start` and `save` accept `-D` and the parameter 
checks moved to one function.
   
   ## Testing
   
   Host: Ubuntu Linux, XC32 v6.00. Target: EV49N51A (PIC32MZ-W1), 
`PIC32MZ_PROGMEM` with FTL and BCH as `/dev/mtdblock1` (apache/nuttx#20788), 
`CONFIG_NETUTILS_WIFIBRIDGE_DHCPD=y`, flashed with a PICkit 3.
   
   - No saved record: `start` uses the defaults (`NuttX-BR`, no DHCP server).
   - `save -s TestD -p abcd1234 -d`, then `start`: the AP is `TestD` and `dhcpd 
br0` runs; the same after a reset. `stop` ends the DHCP server too.
   - `start -D` over a saved `-d`: no DHCP server. After `save -D` and a reset, 
`start`: none; `start -d` over it: the DHCP server runs.
   - `start -d -D` runs without the DHCP server and `start -D -d` with it.
   - `save` with a short passphrase fails with `EINVAL` and keeps the previous 
record.
   - `clear` and a reset: the defaults are back.
   - Earlier run with `-c 11 -a 10.0.0.7`: the record kept the SSID, channel 
and address across resets, and the options of `start` overrode them for one run.
   - `checkpatch` passes.
   
   Not tested: WPA3 (`-3`) saved in the record, which needs the BA414E engine.
   


-- 
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