Commit graph

137 commits

Author SHA1 Message Date
raiden00pl
c706dd87a7 canutils/lely: fix unreliable download/unpack/patch logic
Rebuild from a clean tree in one recipe so a stale state no longer breaks the build.

This commit also simplify some build logic.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-07-06 20:04:57 +08:00
raiden00pl
afe2a0eafc canutils/lely: add dependencies for Kconfig options
some options depends on others and not selecting them can cause compilation errors.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-07-06 08:24:00 +02: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
Shunchao Hu
231ac397a7 canutils/lely-canopen: avoid patch reapply on repeated builds.
The patch step currently uses a phony target, so it is executed
again when the build is repeated in the same source tree. In that
case `patch -N` detects previously applied patches and returns 1,
which make treats as a failure.

Replace the phony patch target with a stamped `.patched` file so
the patch step is not re-run unnecessarily.

Fixes #3188

Signed-off-by: Shunchao Hu <ankohuu@gmail.com>
2026-04-03 11:18:21 +02:00
wangchengdong
d9afe2db8c signals: fix build and runtime issues when signals all isabled
Fix build and runtime issues when signals all disabled.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-19 22:55:19 +08:00
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
raiden00pl
9e2775de98 fix build for canutilis/lely-canopen
This commit fixes lely-canopen build for make and cmake.
It also update lely commit tag to the latest lely master.

The required changes are now split into several patches
to make it easier to fix any issues in the future.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-22 08:53:26 +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
raiden00pl
71d26a5dd1 canutils: change dependency from GPL to BSD
socketCAN utils are dual licence, there is no point in using
GPL licence when we can use BSD.

Also change `select CANUTILS_LIBCANUTILS` to `depends on CANUTILS_LIBCANUTILS`.
We can't `select` that option when `ALLOW_BSD_COMPONENTS` is not set.
2024-10-27 19:46:28 +08:00
Alin Jerpelea
7cabf00380 canutils/libobd2: replace field ch_unused with ch_tcf
https://github.com/apache/nuttx-apps/pull/2635
replaced ch_unused with ch_tcf

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-10-10 02:24:20 +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
guoshichao
a6094d81bb apps/canutils: fix the build warning on greenhills compiler
CC:  stdlib/lib_srand.c "candump.c", line 231: warning #550-D: variable "ret" was set but never used
  	int opt, ret;
  	         ^

"candump.c", line 101: warning #550-D: variable "cmdlinename" was set but
          never used
  static char *cmdlinename[MAXSOCK];
               ^

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-18 20:05:46 +08:00
Xiang Xiao
9d67f38062 canutils: Fix minor style issue found in canlib
no functional change

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-04-12 15:48:21 -03:00
simbit18
7e30c0e4c9 Fix Kconfig style
Remove spaces from Kconfig files
Add TABs
Add comments
2024-04-09 08:16:40 +02:00
Ritvik
6798294129 Fix #2181 : LELYCANOPEN_UNPACKNAME comes from extracted tarball directory 2023-11-09 14:48:15 +01:00
xuxin19
2432a62ab6 fix cmake code smell issues
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-09-04 23:19:26 +08:00
xuxin19
a091b91d83 cmake:replace custom_patch_target with PATCH_COMMAND
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-24 17:49:12 +02:00
Xiang Xiao
054cf3b1cb Change all sizeof(arr)/sizeof(arr[0]) to nitems
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-17 22:51:51 +03:00
xuxin19
dbfe1a33f1 cmake:migrate libopencyphal for cmake build
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-12 15:16:15 +08:00
xuxin19
28a5ecfed1 cmake:migrate libdronecan for cmake build
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-12 15:16:15 +08:00
xuxin19
6e8d83e783 cmake:migrate lely-canopen for cmake build
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-12 15:16:15 +08:00
xuxin19
24319beed3 cmake:migrate apps CMakeLists for canutils
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-09 23:46:21 +08:00
chao an
4d79a5cbaf add initial cmake build system
Co-authored-by: Daniel Agar <daniel@agar.ca>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-08 13:52:02 +08:00
Petro Karashchenko
aed0e2873e apps: fix style issues in code
Add missing FAR and CODE to pointers
Remove FAR for non-pointer variables
Remove extra spaces and align the parameters
Add do {} while(0) wrapper in macro
Use nitems to calculate number of elements in arrays

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-06-11 18:47:50 +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
Peter van der Perk
fa26bab6b2 DroneCAN add socketcan support, rename to DroneCAN
Rename canardv1 to OpenCyphal

Apply suggestions from code review

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-04-25 18:24:41 +08:00
Petro Karashchenko
07d229f514 canutils: fix indentation in Kconfig files
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-03-26 08:33:05 -06:00
simbit18
4713edf5a8 apps/canutils/lely-canopen/Make.defs: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
Xiang Xiao
21bc466a2b Remove the tail space char from all files
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-03 00:18:36 +02:00
lilei19
41f60bd669 change strcpy to strlcpy
Change-Id: I8b9429a3c225a82842fce136bdb14b8b135066d3
Signed-off-by: lilei19 <lilei19@xiaomi.com>
2023-02-22 23:09:55 +08:00
Nathan Hartman
8e77b79f78 Kconfig: Make indent consistent with TABS 2023-02-10 14:11:48 +08: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
a29d9ea9da fsutils/examples: Include unistd.h explicitly
to get the prototypes or macros are defined in it

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-05 08:46:59 +02: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
yinshengkai
ee4d8b738f Makefile: replace INCDIR to INCDIR_PREFIX
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-11-10 02:38:58 +08:00
yinshengkai
2c3c2edcb7 Makefile: Remove INCDIROPT
This option, which resolves to -w when CONFIG_CYGWIN_WINTOOL is
configured, is now appended to INCDIR in tools/Config.mk.

See git commit # 5eae32577e5d5226e5d3027c169eeb369f83f77d in the main
2022-10-25 13:48:16 +08:00
raiden00pl
003dbe1837 Lely CANopen port 2022-10-22 23:31:26 +08:00
Xiang Xiao
4941182cc6 Make.defs: Change "ifeq ($(XXX),y)" to "ifneq ($(XXX),)
to support the tristate option correctly and unify the usage

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 14:59:08 +02:00
Peter van der Perk
819c34e975 Add libcanardv1 for Cyphal, rename libcanard to libcanardv0 2022-08-02 17:01:28 +08: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
Alin Jerpelea
5886bf29a1 apps: canutils: Makefiles: update licenses to Apache
Update Makefiles to Apache license

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-03-08 01:44:49 +08:00
raiden00pl
b5128c401f canutils/libcanutils: remove redundant SocketCAN error definitions, we already have them in nuttx/can.h 2022-01-23 01:34:23 +08:00
raiden00pl
f4a1d28fd5 canutils/slcan: make stacksize configurable 2022-01-23 01:34:23 +08:00
raiden00pl
13fcbcb3d1 canutils/cansend: make stacksize configurable 2022-01-23 01:34:23 +08:00
raiden00pl
267d198212 canutils/candump: make stacksize configurable 2022-01-23 01:34:23 +08:00
Fotis Panagiotopoulos
bc5d8034f1 Typo fixes. 2022-01-06 10:30:41 +08:00