Skip to content

Commit 7e0f886

Browse files
committed
feat:添加can_uds软件包
1 parent d56f35d commit 7e0f886

File tree

2 files changed

+126
-0
lines changed

2 files changed

+126
-0
lines changed

peripherals/can_uds/Kconfig

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
menuconfig PKG_USING_ISO14229
2+
bool "Enable iso14229 (UDS) library"
3+
default n
4+
help
5+
ISO14229-1 (UDS) library for RT-Thread.
6+
This library provides a platform-agnostic UDS client and server implementation
7+
with an RT-Thread porting layer (iso14229_rtt.c).
8+
9+
if PKG_USING_ISO14229
10+
11+
menu "Logging Configuration"
12+
config UDS_LOG_LEVEL
13+
int "Log level"
14+
range 0 5
15+
default 3
16+
help
17+
Set the log level for the UDS library.
18+
0: No log output
19+
1: Errors only
20+
2: Warnings and errors
21+
3: Info, warnings, and errors
22+
4: Debug, info, warnings, and errors
23+
5: Verbose, debug, info, warnings, and errors
24+
25+
config UDS_RTTHREAD_ULOG_ENABLED
26+
bool "Use ULOG for logging"
27+
default y
28+
depends on RT_USING_ULOG
29+
help
30+
If enabled, the library will use RT-Thread's ULOG component.
31+
Otherwise, it will fall back to rt_kprintf.
32+
33+
config UDS_CONFIG_LOG_COLORS
34+
bool "Enable colorized log output (when not using ULOG)"
35+
default y
36+
depends on !UDS_RTTHREAD_ULOG_ENABLED
37+
help
38+
Enables ANSI color codes in the log output.
39+
40+
config UDS_RTTHREAD_LOG_BUFFER_SIZE
41+
int "Buffer size for a single log message (if not using ULOG)"
42+
default 256
43+
depends on !UDS_RTTHREAD_ULOG_ENABLED
44+
endmenu
45+
46+
config UDS_RTT_EVENT_TABLE_SIZE
47+
int "Event Dispatch Table Size"
48+
default 32
49+
help
50+
Specifies the size of the internal lookup table for UDS events.
51+
This value acts as the array size for O(1) event dispatching.
52+
53+
IMPORTANT: This value MUST be greater than the maximum value of the
54+
UDSEvent_t enum (UDS_EVT_MAX).
55+
56+
If the UDS library defines ~28 events, a value of 32 is safe.
57+
If you encounter "Event ID out of range" errors, increase this value.
58+
59+
config UDS_USING_EXAMPLE
60+
bool "Enable UDS server example application"
61+
default n
62+
help
63+
This option compiles the 'examples' directory (app_uds_example.c),
64+
which provides 'uds_example start' and 'uds_example stop' MSH commands.
65+
66+
It demonstrates how to create a UDS instance, register a service (0x2E),
67+
and bind it to a CAN device.
68+
69+
if UDS_USING_EXAMPLE
70+
menu "UDS Server Example Configuration"
71+
config UDS_EXAMPLE_LED_CTRL_DID
72+
hex "DID for LED control"
73+
default 0x0001
74+
help
75+
The Data Identifier (DID) used in the example to control LEDs (Service 0x2E).
76+
77+
config UDS_EXAMPLE_PIN_LED_R
78+
int "GPIO Pin for Red LED"
79+
default -1
80+
help
81+
Set the GPIO pin number for the Red LED. -1 to disable.
82+
83+
config UDS_EXAMPLE_PIN_LED_G
84+
int "GPIO Pin for Green LED"
85+
default -1
86+
87+
config UDS_EXAMPLE_PIN_LED_B
88+
int "GPIO Pin for Blue LED"
89+
default -1
90+
endmenu
91+
endif
92+
93+
endif

peripherals/can_uds/package.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "can_uds",
3+
"description": "ISO14229-1 (UDS) library implementation for RT-Thread. Supports Server/Client modes over CAN (ISO-TP).",
4+
"description_zh": "适用于 RT-Thread 的 ISO14229-1 (UDS) 协议栈实现。支持基于 CAN (ISO-TP) 的服务端与客户端模式,提供易用的注册接口。",
5+
"enable": "PKG_USING_ISO14229",
6+
"keywords": [
7+
"uds",
8+
"iso14229",
9+
"can",
10+
"automotive",
11+
"diagnostic"
12+
],
13+
"category": "peripherals",
14+
"author": {
15+
"name": "hly",
16+
"email": "[email protected]",
17+
"github": "wdfk-prog"
18+
},
19+
"license": "MIT",
20+
"repository": "https://github.com/wdfk-prog/can_uds.git",
21+
"icon": "unknown",
22+
"homepage": "https://github.com/wdfk-prog/can_uds#readme",
23+
"doc": "https://github.com/wdfk-prog/can_uds/blob/master/README.md",
24+
"readme": "ISO14229-1 (UDS) library implementation for RT-Thread.",
25+
"site": [
26+
{
27+
"version": "latest",
28+
"URL": "https://github.com/wdfk-prog/can_uds.git",
29+
"filename": "can_uds.zip",
30+
"VER_SHA": "master"
31+
}
32+
]
33+
}

0 commit comments

Comments
 (0)