Commit graph

696 commits

Author SHA1 Message Date
Abhishek Mishra
608f13fd4b !fsutils/passwd: Replace TEA with PBKDF2-HMAC-SHA256
Migrate passwd encrypt/verify to PBKDF2 modular crypt format using
kernel cryptodev (CRYPTO_PBKDF2_HMAC_SHA256 via /dev/crypto).  Add
passwd_pbkdf2 wrapper, base64url helpers, complexity validation, and
pbkdf2_test for RFC 6070 vector coverage.  FSUTILS_PASSWD selects
CRYPTO, ALLOW_BSD_COMPONENTS, and CRYPTO_CRYPTODEV so existing sim
defconfigs keep building.  Change NSH_LOGIN_USERNAME default to root and
remove fixed-login password defaults.

BREAKING CHANGE: TEA-encoded /etc/passwd entries no longer verify.
Regenerate each entry after upgrading.  Pair with the nuttx host mkpasswd
changes in apache/nuttx#19209.  Boards must enable the appropriate
software or hardware crypto backend for PBKDF2 at runtime.  When
CONFIG_NSH_LOGIN_FIXED=y, set CONFIG_NSH_LOGIN_PASSWORD in the board
defconfig or menuconfig; there is no default password.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-07-22 17:21:22 +08:00
Matteo Golin
4d3bb6e7c9 audioutils/morsey: Add the Morsey library
This commit adds the Morsey library (Apache 2.0 licensed) to be
downloaded from an external repository so it can be used in NuttX
applications.

This library parses ASCII text into Morse code marks to be played by a
user-implemented 'transmit' function (i.e. over an LED, buzzer, audio
sink, etc.).

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-21 05:46:11 -03:00
Matteo Golin
b39228cd41 !examples/audio_rtttl: Implement example using RTTTL library
This commit fixes the audio_rtttl example (which was undocumented and
previously used kernel-level functions) such that now it uses the RTTTL
parsing library. Contributors can implement 'players' for different
types of audio sinks. Currently, PWM is supported.

BREAKING: The previous version of this example only supported a single
board (Spresense) and uses public interfaces from the kernel code. Now
it only uses user-space interfaces and supports any board implementing
those interfaces. Users who relied on the old behaviour should submit a
patch to add a new player to this application which uses the desired
audio sink for the Spresense through user-space interfaces.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-13 10:02:37 +08:00
Arjav Patel
5e91459b1a system/microros: Add UDP and serial custom transport backends.
Micro XRCE-DDS expects the application to supply open/close/write/read
callbacks for the wire transport. Add a single dispatcher that
registers the selected backend via rmw_uros_set_custom_transport(),
plus two backends:

transport/microros_transport_udp.c
  BSD-socket UDP backend. Opens an AF_INET/SOCK_DGRAM socket,
  resolves CONFIG_MICROROS_AGENT_IP/PORT, connect()s it, and uses
  send/recv. The socket fd is stashed in uxrCustomTransport->args
  so no module-level state is needed.

transport/microros_transport_serial.c
  termios serial backend. Opens CONFIG_MICROROS_SERIAL_DEVICE with
  O_RDWR|O_NOCTTY|O_CLOEXEC, switches to raw 8N1 at
  CONFIG_MICROROS_SERIAL_BAUD, and uses poll/read/write. Fd is
  again stashed in uxrCustomTransport->args.

Both backends are mutually exclusive at compile time via Kconfig;
the dispatcher selects which set of callbacks to register. Wired
into both the legacy Make build (CSRCS in system/microros/Makefile)
and the CMake build (separate microros_transport static library
with the transport directory only exposed to its INTERFACE).

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-06-02 00:15:25 +08:00
zhanghongyu
5d15d97418 netlib: replace DNS ping with gateway ping for connectivity check
Refactor netlib_check_ipconnectivity() to use gateway/router ping instead
of DNS server ping for network connectivity checks. Add IPv6 support.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-05-14 11:58:15 +08:00
shichunma
c82957109f netutils: prefer DHCP-provided NTP servers for ntpc
Use the DHCP-learned NTP server list as the default ntpc server source when DHCP option 42 is available.

Fall back to CONFIG_NETUTILS_NTPCLIENT_SERVER only when DHCP does not provide any NTP servers, and restart ntpc when the DHCP-provided server list changes.

Signed-off-by: Jerry Ma <masc2008@gmail.com>
2026-04-24 10:44:08 -03:00
shichunma
4b705721ca netutils/dhcpc: parse DHCP NTP server option
Request DHCP option 42 and store the returned IPv4 NTP server
addresses in struct dhcpc_state for later consumers.

Signed-off-by: Jerry Ma <masc2008@gmail.com>
2026-04-24 10:44:08 -03:00
raiden00pl
773f69d5d9 modbus: add nxmodbus
NxModbus is a lightweight Modbus protocol stack implementation for NuttX RTOS.

This commit adds:
- nxmodbus stack
- nxmbserver - Modbus Server (Slave) example
- nxmbclient - Modbus Client (Master) tool

Supported Modbus transports:
- ASCII
- RTU over serial port
- TCP
- RAW (ADU) for custom transport implementations

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-04-20 12:45:17 -03:00
Piyush Patle
9d849adfab include/debug.h: Use <nuttx/debug.h> in apps
Replace app-side includes of <debug.h> with <nuttx/debug.h> to use the
header from the NuttX tree explicitly after the header move.

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
2026-04-11 10:39:27 -03:00
raiden00pl
193fadfaa8 logging/nxscope: add UDP transfer interface
add UDP transfer interface for nxscope

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-03-18 12:43:50 -03:00
liqinhui
b80d67c628 netutils/netinit: Support the NETINIT_MACADDR
Support getting MAC address from boardctl(BOARDIOC_MACADDR) via NETINIT_MACADDR.

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2026-01-29 12:08:20 +08:00
fangpeina
35f3690a4c nshlib: Add stderr redirection support
This commit implements stderr redirection in HSN, support
Bash-like syntax for redirecting standard error output.
Support both foreground and background commands.

example:
- nsh> ls noexists 2> err.log
- nsh> ls noexists 2> err.log &
- nsh> ls noexists 2>> err.log
- nsh> sh < /dev/ttyS0 > /dev/ttyS0 2> /dev/ttyS1 &
- nsh> sh < /dev/ttyS0 > /dev/ttyS0 2>&1 &

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2026-01-27 03:14:00 +08:00
liqinhui
45a6b0365c netutils/ping: Support ICMP filter for ping.
Add setsockopt support to filter ICMP packets.

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2026-01-19 14:09:31 +08:00
gaohedong
af8ff17f95 netlib: fixed compilation issues
fixed compilation issues

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2026-01-15 10:26:02 +08:00
meijian
b0b90ac728 apps/net: add http connectivity check API
Add netlib_check_httpconnectivity() to verify HTTP service connectivity by sending GET request and validating status code.

Signed-off-by: meijian <meijian@xiaomi.com>
2026-01-13 10:55:40 +08:00
Huang Qi
4e8a0ae4c4 style: Fix coding style violations in nuttx-apps
Fix various coding style issues including:
- Case statement formatting
- Include placement and ordering
- Whitespace issues
- Long line formatting
- Bracket alignment

Affected modules:
- audioutils, examples, include
- netutils, system

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-01-12 00:54:48 +08:00
zhangshuai39
13a019450a netlib: Add an empty macro definition to the two connectivity functions
The `netlib_check_ipconnectivity` and `netlib_check_ifconnectivity` functions depend on the `NETUTILS PING` configuration item. When `NETUTILS PING` is not enabled, a compilation error will occur; therefore, an empty macro definition is added.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2026-01-11 15:54:38 +08:00
meijian
c61fb846d7 apps/net: add if network conntivity check API
Perform connectivity testing on the specified network interface card.

Signed-off-by: meijian <meijian@xiaomi.com>
2026-01-09 14:03:20 +08:00
Zhe Weng
10eae1dc6b vconfig: Support setting default PCP when creating VLAN
Now we allow setting a default PCP when creating VLAN like:
`vconfig add iface-name vlan-id [pcp]`
e.g.
`vconfig add eth0 10` will create eth0.10 with VID=10 and no PCP(0)
`vconfig add eth0 10 3` will create eth0.10 with VID=10 and PCP=3

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2026-01-08 22:51:19 +08:00
Felipe MdeO
ca11a7e093 system/smf: Port SMF .c/.h files to NuttX
This commit add state machine framework lib to the NuttX project. Also an example is added to help users understand and use this feature.

Changes: Added some files. No impact in other features are expected.

Adjust SMF macro names

Fix issues requested during MR review

update kconfig

fix ci-cd issue

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-01-05 12:50:04 -05:00
meijian
3467f9b82d apps/net: add ip address connectivity check API
The system checks connectivity with the input IP address; if no IP address is provided, it defaults to checking DNS server connectivity.

Signed-off-by: meijian <meijian@xiaomi.com>
2026-01-04 00:05:38 +08:00
nuttxs
9ad4c3c395 netutils/dhcpc.h: fix the compilation error caused by undefined
CONFIG_NETDB_DNSSERVER_NAMESERVERS

Provide a default value for CONFIG_NETDB_DNSSERVER_NAMESERVERS if
CONFIG_NETDB_DNSCLIENT is not enabled

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2026-01-02 14:12:10 +01:00
dongjiuzhu1
03ca9ba500 netutils/ptpd: using -B to control BMCA message
new option -B to BMCA message

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
4426ce733a netutils/ptpd: using dynamic config to config clien-only mode and delaye2e
fix compile warning when only enable PTPD_CLIENT or PTPD_SERVER

ptpd.c:493:38: error: 'CONFIG_NETUTILS_PTPD_PRIORITY1' undeclared (first
use in this function); did you mean 'CONFIG_NETUTILS_PTPD_CLIENT'?

ptpd.c:494:39: error: 'CONFIG_NETUTILS_PTPD_CLASS' undeclared (first use
in this function); did you mean 'CONFIG_NETUTILS_PTPD_CLIENT'?

ptpd.c:495:39: error: 'CONFIG_NETUTILS_PTPD_ACCURACY' undeclared (first
use in this function); did you mean 'CONFIG_NETUTILS_PTPD_DEBUG'?
ptpd.c:498:38: error: 'CONFIG_NETUTILS_PTPD_PRIORITY2' undeclared (first
use in this function); did you mean 'CONFIG_NETUTILS_PTPD_CLIENT'?

ptpd.c:502:36: error: 'CONFIG_NETUTILS_PTPD_CLOCKSOURCE' undeclared
(first use in this function); did you mean
'CONFIG_NETUTILS_PTPD_STACKSIZE'?

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
ac881e5108 system/ptpd: provide more parameter by struct ptpd_config_s when starting ptpd
origin command change to new command:
ptpd start interface & -> ptpd -i eth0 &
ptpd stop pid          -> ptpd -d pid
ptpd status pid        -> ptpd -t status

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
Zhe Weng
40c7982816 netlib: Add support for adding/removing VLAN device
Add support for adding/removing VLAN device

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2025-12-30 11:17:38 +08:00
meijian
9da2bc0696 apps/net: add get iobinfo api
Obtain detailed IOB information by parsing the /proc/iobinfo file.

Signed-off-by: meijian <meijian@xiaomi.com>
2025-12-25 12:27:27 -05:00
gaohedong
74c71145da net/ethernet: ARP can be configured on interface
ARP can be configured on interface

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2025-12-25 12:25:02 +08:00
meijian
5d3b2d07d6 ping: add -I for bind device
Add -I option to specify the network device to use for sending ICMP
echo requests. This allows users to explicitly bind ping to a
specific network interface, which is particularly useful in
multi-homed systems with multiple network interfaces.

Signed-off-by: meijian <meijian@xiaomi.com>
2025-12-25 12:24:04 +08:00
meijian
4b3070c081 apps/net: add ip conflict check API
Supports checking for IP conflicts on a NIC.

Signed-off-by: meijian <meijian@xiaomi.com>
2025-12-25 09:44:47 +08:00
nuttxs
92269be92a netutils/netlib: support delete the DNS server address by index or address
- Modify the DHCP-client data structure to support multiple DNS addresses
- Enhance DHCP-option parsing to extract all DNS-server addresses
- Set all received DNS-server addresses
- fix some test case build error

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-11-10 18:10:16 +08:00
Halysson
ddf1dcc3ff netutils/cmux: Add support for CMUX protocol
This commit adds CMUX (GSM 07.10) protocol support to netutils.
CMUX allows multiplexing multiple virtual serial connections
over a single physical serial link.

Changes include:
- CMUX protocol implementation
- CRC table for frame validation
- Basic frame handling

Signed-off-by: Halysson <halysson1007@gmail.com>
2025-10-06 15:04:22 -03:00
Zhe Weng
7a2d5bbc64 apps/graphics: Add input generator library
We can use it to unify our monkey / input tools, and for other input
generation purposes easily.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2025-08-12 20:20:01 +08:00
Matteo Golin
d334c5eb67 apps/unity: Add printf configuration
Allows the user to select whether or not they want access to the Unity
``TEST_PRINTF`` commands.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-08-07 11:21:57 +08:00
nuttxs
8f3c3c57f9 netutils/dhcpc/dhcpc: add implementation to get renewal (T1) time and
rebinding (T2) time from DHCP packet.
According to RFC 2131, T1 and T2 times play a critical role in lease
management in DHCP clients.

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-08-06 10:54:18 +08:00
SPRESENSE
5e704891d9 netutils/esp8266: Add a function for finalization.
Add a function for finalization so that it can be used repeatedly.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-07-22 15:04:36 +02:00
SPRESENSE
5429191ab0 netutils/esp8266: Fix nxstyle
Fix nxstyle.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-07-22 15:04:36 +02:00
SPRESENSE
8b4a015f07 netutils/esp8266: Fix compile error
Fix compile error.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-07-22 15:04:36 +02:00
nuttxs
dfeeef41ed netutils/dhcpc/dhcpc.c:Implement a dedicated interface to send
DHCPRELEASE, According to RFC 2131 section 3.1, DHCPRELEASE is
used by a client to relinquish a network address and cancel any
remaining lease time

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-07-14 15:49:29 -03:00
Tim Hardisty
30b1c024a1 apps/netutils: add mdns library support
This commit allows an external mDNS library to be included in NuttX.

It originates from here: <https://github.com/mjansson/mdns>

It is declared as being in the Public Domain as per <http://unlicense.org>

Signed-off-by: Tim Hardisty <timh@jti.uk.com>
2025-06-02 23:18:24 +08:00
raiden00pl
a8740c2602 logging/nxscope: fix various warnings reported by CodeChekcer
fix various warnings reported by CodeChekcer for nxscope

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-05-17 12:02:32 +08:00
raiden00pl
71df58e937 logging/nxscope: allow use in C++ code
allow nxscope to use in C++ code

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-05-17 12:01:42 +08:00
Alin Jerpelea
064c6e16f7 include: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:25:28 +08:00
jianglianfang
0c467dc02d audioutils/nxaudio: added pause/resume interface in nxaudio.h
Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-11-11 17:18:09 +08:00
wangjianyu3
3da204c23e Pack parameters of nsh_execute() as struct nsh_exec_param_s
1. Input redirect flags currently is hardcode, passing by arguments maybe better.
2. Only support redirect to path_name, redirect to fd is needed for pipeline.

Test
  1. Redirect in
    cat < /etc/init.d/rc.sysinit

  2. Redirect with FIFO
    mkfifo /dev/testfifo
    cat /dev/testfifo &
    ls > /dev/testfifo

  3. NSH Params
    set name `uname`
    echo $name

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-11 10:36:46 +08:00
Huang Qi
5048d6b472 tools: Add essential math.h for wasm build
If the experimental feature Wasm build enabled with multi thread
compiling, the COPYFILE (cp) maybe raise the error below:
```
cp: cannot create regular file 'math.h': file exists
```

This error cause by that the wasi-sdk don't provide the math.h for
non-wasi envrioment, for this case, provide a math.h for it instead of copy
file each time is better.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-11-06 01:38:10 +08:00
meijian
e25f89d2d6 app/netstatistics: Add net statistics api for user
Signed-off-by: meijian <meijian@xiaomi.com>
2024-09-12 13:38:38 +08:00
meijian
7bf20f1a89 [wireless] add set/get pmksa api for fast-auth
Signed-off-by: meijian <meijian@xiaomi.com>
2024-09-12 12:43:52 +08:00
meijian
cf7491a1fe [wireless][wapi] add powersave cmd of wapi for Low-power modules
Signed-off-by: meijian <meijian@xiaomi.com>
2024-09-12 12:43:52 +08:00
meijian
c5541bfb56 [wireless][wapi] add extend api for private needs
Signed-off-by: meijian <meijian@xiaomi.com>
2024-09-12 12:43:52 +08:00