This patch adds support for dumping binary contents from noteram via the
`trace dump -b <file>` command. Changes include:
- Add a `binary` parameter to `trace_dump()` and the public header
`system/trace/trace.h` to indicate binary output mode.
- Update `trace_dump()` to set the noteram read mode to binary using
`NOTERAM_SETREADMODE` when requested.
- Update `trace dump` CLI parsing in `system/trace/trace.c` to accept
the `-b` flag and pass it through to `trace_dump()`.
- Update usage/help text to include the new `-b` option.
Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
Add missing header files in netutils and lsan modules to fix
implicit function declarations and improve compilation compatibility.
Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
- crypto/mbedtls: Add -Wno-cpp flag to suppress warnings
- interpreters/quickjs: Add flags to suppress warnings
- lte/alt1250: Fix spelling issues in comments
- system/dd: Add missing includes for modern compilers
- system/zlib: Add -Wno-cpp flag
- testing/cxx: Include missing algorithm header
Signed-off-by: Bartosz <bartol2205@gmail.com>
Fix buffer offset calculation in ymodem_send_buffer() to correctly
handle partial writes by advancing the buffer pointer and adjusting
the remaining size on each retry.
Signed-off-by: fangpeina <fangpeina@xiaomi.com>
Fixes a bug where newfd is not properly closed when newfd[0] equals newfd[1].
This can cause file descriptor leaks in certain edge cases where the read
and write sides of the pipe are duplicated.
Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
Merge the cu.h header file contents into cu_main.c to simplify the
code structure. The cu_globals_s structure and related definitions
are now directly in cu_main.c.
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
The sigint() function uses siginfo->si_user but was declared with
only one parameter (int sig). This causes compilation error because
siginfo is undeclared.
Fix by:
1. Rename sigint to cu_exit with proper sigaction signature
2. Use sa_sigaction instead of sa_handler to receive siginfo_t
3. Pass cu pointer via sa.sa_user for signal handler access
Signed-off-by: makejian <makejian@xiaomi.com>
Update the libuv NuttX port patch to change sendmsg() parameter from
"struct msghdr *msg" to "const struct msghdr *msg" in the NuttX-specific
implementation stub. This maintains compatibility after NuttX's socket API
was made POSIX-compliant with const-correct parameters.
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
the kernel can only prevent the concurrency of s/getsockopt, but
iptables will call these interfaces multiple times at a time. We
need to wait for one iptables to complete before executing the second
one, otherwise the data will be overwritten.
iptables flow:
get current iptables entries [1] -> add new entry 2 [1,2] -> set to kernel [1,2]
get current iptables entries [1] -> add new entry 3 [1,3] -> set to kernel [1,3]
entry 2 is lost
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
the configured mask should be in network byte order, but the logic here
calculates it as host byte order.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
Fix dependency issue when signals are partially or fully enabled
Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
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>
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>
Ref: https://man7.org/linux/man-pages/man7/packet.7.html
We should either set protocal when creating socket or binding, otherwise
we cannot capture any packet.
Signed-off-by: gaohedong <gaohedong@xiaomi.com>
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>
Initialize info.devname to NULL to solve the problem of the SO-BINDTODEVICE property being set incorrectly in the icmp_ping function
Signed-off-by: wangchen <wangchen41@xiaomi.com>
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>
Due to DMA-based transfers, the rx buffer can receive a large amount
of data at once. The previous character-by-character processing approach
was inefficient.
Modify character-by-character read to block read of the entire buffer.
This improves throughput and reduces CPU overhead, especially for high-speed
serial communication or other DMA-based transfers.
Signed-off-by: fangpeina <fangpeina@xiaomi.com>
For TCP-based adb, if the current CPU contains TCP protocol stack,
then NET_TCPBACKLOG needs to be enabled.
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
Without this configuration, when executing exit in adb shell,
adb will not be able to exit because it cannot receive the
close packet.
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
when use cmd 'spi exch -b 1 -f 3000000 -m 1 -n 0 -w 32 -x 1 1f',
the last character '1f' can not be trans out.
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
apps/system/fastboot/fastboot.c:351:43: error: '%s' directive output may be truncated writing up to 63 bytes into a region of size 60 [-Werror=format-truncation=] ...... apps/system/fastboot/fastboot.c:351:3: note: 'snprintf' output between 5 and 68 bytes into a destination of size 64 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ apps/system/fastboot/fastboot.c:351:43: error: '%s' directive output may be truncated writing up to 63 bytes into a region of size 60 [-Werror=format-truncation=] ...... apps/system/fastboot/fastboot.c:351:3: note: 'snprintf' output between 5 and 68 bytes into a destination of size 64 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>