Commit graph

16 commits

Author SHA1 Message Date
Carlos Sanchez
f94bccf119 canutils/slcan: explicitly manage the interface.
A recent change (https://github.com/apache/nuttx/pull/16199) has made the bitrate setting no
longer bring the interface up. Moreover, it is now no longer possible to change bitrate
of a CAN interface if it is up. Therefore, slcan needs to bring the interface down
to change it. Fortunately, it already had commands to open and close the interface
which map nicely to this.

Signed-off-by: Carlos Sanchez <carlossanchez@geotab.com>
2025-04-23 22:30:47 +08:00
Carlos Sanchez
4fb47a6a6d canutils/slcan: Work with CAN interfaces with names longer than 4 characters.
Signed-off-by: Carlos Sanchez <carlossanchez@geotab.com>
2025-04-23 22:30:47 +08:00
Carlos Sanchez
8d89d73bb8 canutils: use bps units for bitrate in SocketCAN interfaces.
This matches PR https://github.com/apache/nuttx/pull/16225 in Nuttx where
units for SocketCAN bitrate ioctls were changed.
2025-04-17 15:39:43 +08:00
Huang Qi
ffd256d32b Remove unused header files across multiple source files
Clean up code by removing redundant and unused header file includes that were identified through static analysis.
This improves code readability and reduces unnecessary dependencies.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-10 21:42:00 +08:00
Alin Jerpelea
440d69a310 canutils: 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
gaohedong
481d4b6e23 can: Merge netpacket/can.h into nuttx/can.h
This patch is associated with 'https://github.com/apache/nuttx/pull/13048', so it cannot be verified separately by CI. Please help to associate and review it. Thank you!

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2024-08-26 05:05:41 -04:00
xuxin19
24319beed3 cmake:migrate apps CMakeLists for canutils
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-09 23:46:21 +08:00
Xiang Xiao
7c37421266 Replace all sprintf with snprintf
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-08 21:35:16 +03:00
chao an
8ad4ae5508 net: fix compiler warning
sixlowpan_assocresp.c: In function ‘sixlowpan_assoc_resp’:
sixlowpan_assocresp.c:48:3: warning: ‘strncpy’ specified bound 16 equals destination size [-Wstringop-truncation]
   48 |   strncpy(arg.ifr_name, ifname, IFNAMSIZ);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-08 00:35:39 +08:00
Xiang Xiao
dd5dbde620 Fix Error: slcan.c:266:60: error: format specifies type 'unsigned long' but the argument has type 'canid_t' (aka 'unsigned int') [-Werror,-Wformat]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-13 14:55:30 +01:00
Xiang Xiao
8094ced139 Fix Error: slcan.c:265:19: error: variable 'reccount' is uninitialized when used here [-Werror,-Wuninitialized]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-13 14:55:30 +01:00
Xiang Xiao
a12707177b Remove "| O_BINARY" or " |= O_BINARY" since O_BINARY is 0 now
follow nuttx kernel side change

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-06-07 20:22:38 +03:00
raiden00pl
f4a1d28fd5 canutils/slcan: make stacksize configurable 2022-01-23 01:34:23 +08:00
Jari van Ewijk
7cbe2db2c9 SLCAN: Fix incorrect format identifier in print function 2021-09-17 08:20:08 -05:00
Peter van der Perk
b7ef4fb513 canutils/slcan: use syslog and cleanup 2021-01-21 11:12:14 -03:00
Peter van der Perk
e12e8016f2 canutils/slcan: Add SLCAN utility 2021-01-21 11:12:14 -03:00