CANConfigPython 0.1.0a1__py3-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- canconfigpython/__init__.py +7 -0
- canconfigpython/__main__.py +3 -0
- canconfigpython/cli.py +111 -0
- canconfigpython/client.py +243 -0
- canconfigpython/commands.py +57 -0
- canconfigpython/errors.py +19 -0
- canconfigpython/resources/docs/native-source.tar.gz +0 -0
- canconfigpython/resources/docs/user-guide.en.md +274 -0
- canconfigpython/resources/docs/user-guide.zh-CN.md +265 -0
- canconfigpython/resources/skill/canconfig-python/SKILL.md +71 -0
- canconfigpython/resources/skill/canconfig-python/agents/openai.yaml +4 -0
- canconfigpython/resources/skill/canconfig-python/assets/changes.schema.json +832 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/bridge_dual_rates.json +18 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/bridge_mapping.json +13 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/cancom_115200_8n1.json +10 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/cancom_format_crc.json +8 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/cancom_gap.json +8 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/cancom_transparent_id.json +10 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/fb_1m.json +12 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/fb_500k.json +12 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/fb_adaptive_single.json +7 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/fb_return_manual.json +22 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/fb_silent_adaptive_option.json +7 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/filter_blacklist.json +7 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/filter_mask.json +12 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/filter_range.json +12 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/hub_h_external.json +13 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/hub_input_filter.json +13 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/hub_l_external.json +13 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/hub_mapping.json +46 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/hub_routing.json +8 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/index.en.md +55 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/index.json +661 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/index.zh-CN.md +55 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/negative/adaptive_mixed.json +8 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/negative/hub_missing_ps.json +12 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/negative/restricted_inheritance.json +12 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/negative/short_user_data.json +7 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/negative/string_numeric_id.json +7 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/negative/unknown_field.json +7 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/negative/unsupported_adaptive.json +7 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/negative/wrong_uid.json +7 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/rpt_adaptive_all.json +12 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/rpt_silent.json +7 -0
- canconfigpython/resources/skill/canconfig-python/assets/examples/user_data.json +7 -0
- canconfigpython/resources/skill/canconfig-python/references/operations.md +68 -0
- canconfigpython/resources.py +17 -0
- canconfigpython/runtime/Qt5Core.dll +0 -0
- canconfigpython/runtime/Qt5Network.dll +0 -0
- canconfigpython/runtime/Qt5SerialPort.dll +0 -0
- canconfigpython/runtime/WIICAN.dll +0 -0
- canconfigpython/runtime/canconfigconsole.exe +0 -0
- canconfigpython/runtime/libgcc_s_dw2-1.dll +0 -0
- canconfigpython/runtime/libstdc++-6.dll +0 -0
- canconfigpython/runtime/libwinpthread-1.dll +0 -0
- canconfigpython/runtime/manifest.json +19 -0
- canconfigpython/runtime.py +61 -0
- canconfigpython-0.1.0a1.dist-info/GPL-3.0.txt +674 -0
- canconfigpython-0.1.0a1.dist-info/LICENSE +21 -0
- canconfigpython-0.1.0a1.dist-info/METADATA +197 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-LICENSE.txt +866 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-LICENSE.FDL.txt +450 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-LICENSE.GPL2.txt +339 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-LICENSE.GPL3-EXCEPT.txt +704 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-LICENSE.GPL3.txt +674 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-LICENSE.GPLv3.txt +686 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-LICENSE.LGPL3.txt +165 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-LICENSE.LGPLv21.txt +514 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-LICENSE.LGPLv3.txt +175 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-LICENSE.PREVIEW.COMMERCIAL.txt +626 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__angle__LICENSE.txt +32 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__angle__src__libANGLE__renderer__d3d__d3d11__dxgi_support_data.json.txt +1164 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__angle__src__libANGLE__renderer__d3d__d3d11__load_functions_data.json.txt +1116 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__angle__src__libANGLE__renderer__d3d__d3d11__swizzle_format_data.json.txt +77 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__angle__src__libANGLE__renderer__d3d__d3d11__texture_format_data.json.txt +692 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__angle__src__third_party__compiler__LICENSE.txt +22 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__angle__src__third_party__murmurhash__LICENSE.txt +2 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__double-conversion__LICENSE.txt +26 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__easing__easing.cpp.txt +670 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__easing__legal.qdoc.txt +35 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__forkfd__forkfd.c.txt +875 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__forkfd__forkfd.h.txt +66 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__forkfd__forkfd_gcc.h.txt +63 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__freebsd__0001-Patch-the-FreeBSD-strto-u-ll-functions-to-work-insid.patch.txt +151 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__freebsd__strtoll.c.txt +134 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__freebsd__strtoull.c.txt +112 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__freetype__docs__LICENSE.TXT.txt +37 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__freetype__src__tools__no-copyright.txt +61 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__freetype__src__tools__update-copyright-year.txt +135 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__freetype__src__tools__update-copyright.txt +14 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__harfbuzz-ng__COPYING.txt +36 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__harfbuzz__COPYING.txt +24 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__libpng__LICENSE.txt +112 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__md4__md4.cpp.txt +265 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__md4__md4.h.txt +31 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__md5__md5.cpp.txt +247 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__md5__md5.h.txt +48 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__pcre__COPYING.txt +5 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__pcre__LICENCE.txt +93 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__rfc6234__patches__0001-Fix-compilation-MSVC-warning-in-3rdparty-rfc6234.patch.txt +86 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__rfc6234__sha-private.h.txt +28 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__rfc6234__sha.h.txt +357 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__rfc6234__sha224-256.c.txt +583 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__rfc6234__sha384-512.c.txt +1034 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__sha1__sha1.cpp.txt +261 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__sha3__KeccakF-1600-32-rvk.macros.txt +555 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__sha3__KeccakF-1600-32.macros.txt +26 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__sha3__KeccakF-1600-64.macros.txt +728 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__sha3__KeccakF-1600-int-set.h.txt +6 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__sha3__KeccakF-1600-interface.h.txt +46 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__sha3__KeccakF-1600-opt32-settings.h.txt +4 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__sha3__KeccakF-1600-opt32.c.txt +524 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__sha3__KeccakF-1600-opt64-settings.h.txt +7 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__sha3__KeccakF-1600-opt64.c.txt +512 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__sha3__KeccakF-1600-unrolling.macros.txt +124 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__sha3__KeccakNISTInterface.c.txt +82 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__sha3__KeccakNISTInterface.h.txt +70 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__sha3__KeccakSponge.c.txt +266 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__sha3__KeccakSponge.h.txt +80 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__sha3__brg_endian.h.txt +142 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtbase-src__3rdparty__xkbcommon__COPYING.txt +188 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtserialport-LICENSE.FDL.txt +450 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtserialport-LICENSE.GPL2.txt +339 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtserialport-LICENSE.GPL3-EXCEPT.txt +704 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtserialport-LICENSE.GPL3.txt +674 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtserialport-LICENSE.GPLv2.txt +292 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtserialport-LICENSE.GPLv3.txt +686 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtserialport-LICENSE.LGPL3.txt +165 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtserialport-LICENSE.LGPLv21.txt +514 -0
- canconfigpython-0.1.0a1.dist-info/Qt-5.7.1-qtserialport-LICENSE.LGPLv3.txt +175 -0
- canconfigpython-0.1.0a1.dist-info/RECORD +165 -0
- canconfigpython-0.1.0a1.dist-info/THIRD_PARTY_NOTICES.md +69 -0
- canconfigpython-0.1.0a1.dist-info/WHEEL +5 -0
- canconfigpython-0.1.0a1.dist-info/entry_points.txt +3 -0
- canconfigpython-0.1.0a1.dist-info/gcc-COPYING.RUNTIME.txt +73 -0
- canconfigpython-0.1.0a1.dist-info/gcc-COPYING3.LIB.txt +165 -0
- canconfigpython-0.1.0a1.dist-info/gcc-COPYING3.txt +674 -0
- canconfigpython-0.1.0a1.dist-info/linux-libc6-copyright.txt +529 -0
- canconfigpython-0.1.0a1.dist-info/linux-libcap2-copyright.txt +112 -0
- canconfigpython-0.1.0a1.dist-info/linux-libcom-err2-copyright.txt +403 -0
- canconfigpython-0.1.0a1.dist-info/linux-libdouble-conversion3-copyright.txt +41 -0
- canconfigpython-0.1.0a1.dist-info/linux-libgcc-s1-copyright.txt +1532 -0
- canconfigpython-0.1.0a1.dist-info/linux-libglib2.0-0t64-copyright.txt +1250 -0
- canconfigpython-0.1.0a1.dist-info/linux-libgssapi-krb5-2-copyright.txt +1374 -0
- canconfigpython-0.1.0a1.dist-info/linux-libicu74-copyright.txt +49 -0
- canconfigpython-0.1.0a1.dist-info/linux-libk5crypto3-copyright.txt +1374 -0
- canconfigpython-0.1.0a1.dist-info/linux-libkeyutils1-copyright.txt +52 -0
- canconfigpython-0.1.0a1.dist-info/linux-libkrb5-3-copyright.txt +1374 -0
- canconfigpython-0.1.0a1.dist-info/linux-libkrb5support0-copyright.txt +1374 -0
- canconfigpython-0.1.0a1.dist-info/linux-libpcre2-16-0-copyright.txt +122 -0
- canconfigpython-0.1.0a1.dist-info/linux-libpcre2-8-0-copyright.txt +122 -0
- canconfigpython-0.1.0a1.dist-info/linux-libqt5core5t64-copyright.txt +2932 -0
- canconfigpython-0.1.0a1.dist-info/linux-libqt5network5t64-copyright.txt +2932 -0
- canconfigpython-0.1.0a1.dist-info/linux-libqt5serialport5-copyright.txt +134 -0
- canconfigpython-0.1.0a1.dist-info/linux-libstdc++6-copyright.txt +1532 -0
- canconfigpython-0.1.0a1.dist-info/linux-libudev1-copyright.txt +287 -0
- canconfigpython-0.1.0a1.dist-info/linux-libzstd1-copyright.txt +123 -0
- canconfigpython-0.1.0a1.dist-info/linux-packages.json +102 -0
- canconfigpython-0.1.0a1.dist-info/linux-zlib1g-copyright.txt +84 -0
- canconfigpython-0.1.0a1.dist-info/mingw-w64-COPYING.MinGW-w64-runtime.txt.txt +240 -0
- canconfigpython-0.1.0a1.dist-info/mingw-w64-COPYING.MinGW-w64.txt.txt +135 -0
- canconfigpython-0.1.0a1.dist-info/mingw-w64-COPYING.txt +43 -0
- canconfigpython-0.1.0a1.dist-info/qt-source-notices.json +278 -0
- canconfigpython-0.1.0a1.dist-info/top_level.txt +1 -0
- canconfigpython-0.1.0a1.dist-info/winpthreads-COPYING.txt +57 -0
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
# CANConfigPython user guide
|
|
2
|
+
|
|
3
|
+
Applies to Python CLI 0.1.0a1 / Console 2.3 / bridge API 1.
|
|
4
|
+
Supports configuration of CANHub, CANFB, CANBridge, CANRPT and CANCOM.
|
|
5
|
+
Consult the release validation record for tested platforms and hardware evidence.
|
|
6
|
+
|
|
7
|
+
## Install and check without hardware
|
|
8
|
+
|
|
9
|
+
Use Python 3.8+ in a virtual environment. Install the supplied wheel matching your
|
|
10
|
+
platform; until publication there is no public package to install.
|
|
11
|
+
The wheel includes Console, WIICAN and required Qt libraries. No GUI installation
|
|
12
|
+
or graphical desktop is needed.
|
|
13
|
+
|
|
14
|
+
Windows PowerShell:
|
|
15
|
+
~~~powershell
|
|
16
|
+
python -m venv .venv
|
|
17
|
+
.\.venv\Scripts\python.exe -m pip install .\canconfigpython-0.1.0a1-py3-none-win_amd64.whl
|
|
18
|
+
.\.venv\Scripts\canconfig.exe doctor --json
|
|
19
|
+
~~~
|
|
20
|
+
|
|
21
|
+
Linux: create an environment with `python3 -m venv .venv`, activate with
|
|
22
|
+
`. .venv/bin/activate`, then install the actual supplied Linux wheel using
|
|
23
|
+
`python -m pip install ./WHEEL_FILENAME.whl`. Its manylinux tag states the minimum
|
|
24
|
+
glibc version established by the build. This release requires x86_64 and glibc 2.38+;
|
|
25
|
+
it was built/tested on Ubuntu 24.04 / Python 3.12 with Qt 5.15.13.
|
|
26
|
+
Use `ldd --version` to check glibc. ARM64, musl and macOS are not supported.
|
|
27
|
+
|
|
28
|
+
After publication: `python -m pip install --pre CANConfigPython`.
|
|
29
|
+
Upgrade: `python -m pip install --upgrade --pre CANConfigPython`.
|
|
30
|
+
Uninstall: `python -m pip uninstall CANConfigPython`. Your backups and exported
|
|
31
|
+
documentation/Skill remain your files.
|
|
32
|
+
|
|
33
|
+
~~~console
|
|
34
|
+
canconfig --version --json
|
|
35
|
+
canconfig doctor --json
|
|
36
|
+
canconfig schema --json
|
|
37
|
+
canconfig apply --help
|
|
38
|
+
canconfig docs export --output ./canconfig-docs
|
|
39
|
+
canconfig skill export --output ./canconfig-skill
|
|
40
|
+
~~~
|
|
41
|
+
|
|
42
|
+
Doctor checks hashes, backend contract, library loading and exports without opening
|
|
43
|
+
devices. Success: ok=true, exit_code=0, data.device_opened=false.
|
|
44
|
+
Schema is a descriptive contract envelope, not a JSON Schema or patch file.
|
|
45
|
+
Resource export requires a new directory. Copy the complete exported Skill folder,
|
|
46
|
+
including references/assets, into your Agent's skill directory if desired.
|
|
47
|
+
Package installation never changes Agent settings.
|
|
48
|
+
|
|
49
|
+
If runtime_invalid/runtime_load_failed occurs, reinstall the complete matching
|
|
50
|
+
wheel. Do not mix libraries from unrelated GUI installations. Developers replacing
|
|
51
|
+
libraries should use the project's build/staging instructions.
|
|
52
|
+
|
|
53
|
+
## Select the device and interpret results
|
|
54
|
+
|
|
55
|
+
Choose an explicit COM port on Windows, for example COM3. On Linux use a confirmed
|
|
56
|
+
/dev/ttyACM0 or /dev/serial/by-id/... path; names are case-sensitive.
|
|
57
|
+
Inspect `ls -l /dev/serial/by-id/`, the selected node and `id` to diagnose access.
|
|
58
|
+
An administrator can add your account to the actual device group (often dialout);
|
|
59
|
+
log in again afterwards. Do not default to sudo or make the device world-writable.
|
|
60
|
+
|
|
61
|
+
~~~console
|
|
62
|
+
canconfig info --port COM3 --json
|
|
63
|
+
~~~
|
|
64
|
+
|
|
65
|
+
Replace COM3 with the actual selected port. Match data.device.uid/type/hardware/
|
|
66
|
+
firmware and capabilities against the intended device. Info does not return a full
|
|
67
|
+
configuration. Writable field names do not guarantee current-state writability.
|
|
68
|
+
Info and configuration dry-run are live connections and can change device run mode.
|
|
69
|
+
Only operate when maintenance access is authorized. Keep other applications off
|
|
70
|
+
the port; Python locks only coordinate this user's CANConfigPython processes.
|
|
71
|
+
|
|
72
|
+
Operations emit UTF-8 JSON; --json selects one compact line. Check the process exit
|
|
73
|
+
code, ok, effects and verification together. PowerShell 5.1 capture requires temporary
|
|
74
|
+
UTF-8 Console.OutputEncoding; restore it afterwards.
|
|
75
|
+
|
|
76
|
+
- attempted/submitted/acknowledged/save_acknowledged count writes and acknowledgements.
|
|
77
|
+
- none means no reported configuration writes; a connection can still change run mode.
|
|
78
|
+
- applied/transferred must be read alongside verification.
|
|
79
|
+
- partial/unknown means stop automatic retry or rollback.
|
|
80
|
+
- Missing valid final backend output gives unknown counts as null, never invented zeros.
|
|
81
|
+
- readback=matched is current readback; power_cycle=not_verified is not persistence proof.
|
|
82
|
+
|
|
83
|
+
## Credentials and cleanup
|
|
84
|
+
|
|
85
|
+
Passwords are 1–10 UTF-8 bytes without NUL. Characters may take multiple bytes.
|
|
86
|
+
The CLI accepts environment variable names only. Do not put secrets in arguments,
|
|
87
|
+
source, persistent files, reports or chat. Administrators may inspect process
|
|
88
|
+
environments; environment variables are not a secret vault.
|
|
89
|
+
|
|
90
|
+
PowerShell template; replace the port, filename and UID before use:
|
|
91
|
+
~~~powershell
|
|
92
|
+
$originalEncoding = [Console]::OutputEncoding
|
|
93
|
+
$secure = Read-Host 'Device password' -AsSecureString
|
|
94
|
+
try {
|
|
95
|
+
[Console]::OutputEncoding = New-Object System.Text.UTF8Encoding($false)
|
|
96
|
+
$env:CAN_PASSWORD = [System.Net.NetworkCredential]::new('', $secure).Password
|
|
97
|
+
$raw = canconfig export --port COM3 --file .\backup-new.ini --password-env CAN_PASSWORD --expect-uid 'CONFIRMED-DEVICE-UID' --json
|
|
98
|
+
$exitCode = $LASTEXITCODE
|
|
99
|
+
$result = $raw | ConvertFrom-Json
|
|
100
|
+
$result | ConvertTo-Json -Depth 20
|
|
101
|
+
if ($exitCode -ne 0 -or -not $result.ok) { throw 'Stop and inspect effects/verification.' }
|
|
102
|
+
}
|
|
103
|
+
finally {
|
|
104
|
+
Remove-Item Env:CAN_PASSWORD -ErrorAction SilentlyContinue
|
|
105
|
+
$secure.Dispose()
|
|
106
|
+
[Console]::OutputEncoding = $originalEncoding
|
|
107
|
+
}
|
|
108
|
+
~~~
|
|
109
|
+
|
|
110
|
+
Linux Bash:
|
|
111
|
+
~~~bash
|
|
112
|
+
(
|
|
113
|
+
trap 'unset CAN_PASSWORD' EXIT
|
|
114
|
+
read -r -s -p 'Device password: ' CAN_PASSWORD
|
|
115
|
+
printf '\n'
|
|
116
|
+
export CAN_PASSWORD
|
|
117
|
+
canconfig export --port /dev/ttyACM0 --file ./backup-new.ini \
|
|
118
|
+
--password-env CAN_PASSWORD --expect-uid 'CONFIRMED-DEVICE-UID' --json
|
|
119
|
+
rc=$?
|
|
120
|
+
if [ "$rc" -ne 0 ]; then
|
|
121
|
+
printf 'Stop and inspect effects/verification.\n' >&2
|
|
122
|
+
exit "$rc"
|
|
123
|
+
fi
|
|
124
|
+
)
|
|
125
|
+
~~~
|
|
126
|
+
|
|
127
|
+
Place authenticated commands below inside the same try/subshell template. Cleanup
|
|
128
|
+
must also run when file preparation or JSON parsing fails. Save operation results
|
|
129
|
+
as needed; they may contain device identity/configuration and deserve appropriate handling.
|
|
130
|
+
|
|
131
|
+
## Back up, validate and restore
|
|
132
|
+
|
|
133
|
+
Backups are INI. A successful export replaces an existing destination, so choose a
|
|
134
|
+
fresh filename associated with the device/time.
|
|
135
|
+
|
|
136
|
+
~~~console
|
|
137
|
+
canconfig export --port COM3 --file backup-new.ini --password-env CAN_PASSWORD --expect-uid UID --json
|
|
138
|
+
canconfig validate --file backup-new.ini --json
|
|
139
|
+
canconfig restore --port COM3 --file backup-new.ini --password-env CAN_PASSWORD --expect-uid UID --check-device --dry-run --json
|
|
140
|
+
~~~
|
|
141
|
+
|
|
142
|
+
UID means the confirmed full device UID, not the literal word UID. Inspect data.file
|
|
143
|
+
and data.complete after export. Validate is offline and accepts INI only.
|
|
144
|
+
Restore dry-run connects and checks identity/state but performs no SET/WRITE/SAVE.
|
|
145
|
+
Review fields, write_count and save_domains. Within existing authorization, remove
|
|
146
|
+
only --dry-run to execute the unchanged request. Require ok=true and matched readback.
|
|
147
|
+
|
|
148
|
+
For partial backups use matching explicit --sections on export, validate and restore.
|
|
149
|
+
Choices: all, parameters, filters, filter_mode, mapping, options, routing, cancom,
|
|
150
|
+
user_data; join sections with commas. Default all means all supported sections.
|
|
151
|
+
Explicitly requesting an unsupported section fails.
|
|
152
|
+
|
|
153
|
+
--expect-uid fixes the current target; --check-device also matches the backup UID.
|
|
154
|
+
Only omit --check-device for an explicitly authorized compatible migration; retain
|
|
155
|
+
the target UID guard. Never silently rewrite a mismatched backup UID. Do not disable
|
|
156
|
+
adaptive mode simply to obtain a backup that export refuses.
|
|
157
|
+
|
|
158
|
+
## Apply JSON edits
|
|
159
|
+
|
|
160
|
+
Export the Skill, read assets/examples/index.en.md and copy a suitable model-specific
|
|
161
|
+
example into your working directory. Replace only the template's all-zero UID with
|
|
162
|
+
the confirmed target, then edit authorized fields. A nonzero UID mismatch in an
|
|
163
|
+
existing request is a stop condition.
|
|
164
|
+
|
|
165
|
+
Structural illustration for CANBridge, not universal timing values:
|
|
166
|
+
~~~json
|
|
167
|
+
{
|
|
168
|
+
"schema_version": 1,
|
|
169
|
+
"device_uid": "0000-0000-0000-0000-0000-0000",
|
|
170
|
+
"changes": {
|
|
171
|
+
"CAN1_PARAMETER/BRT": [500000, 1, 13, 2]
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
~~~
|
|
175
|
+
|
|
176
|
+
Use UTF-8 without BOM, exact case and only the three top-level keys. No $schema,
|
|
177
|
+
comments, duplicate keys or nonfinite values. In PowerShell 5.1 do not use > to
|
|
178
|
+
create JSON; explicitly use File.WriteAllText with UTF8Encoding(false).
|
|
179
|
+
If preparation fails, stop instead of executing an old file.
|
|
180
|
+
Python parses a stable snapshot strictly; Console validates device-specific rules.
|
|
181
|
+
|
|
182
|
+
~~~console
|
|
183
|
+
canconfig apply --port COM3 --file changes.json --password-env CAN_PASSWORD --expect-uid UID --dry-run --json
|
|
184
|
+
canconfig apply --port COM3 --file changes.json --password-env CAN_PASSWORD --expect-uid UID --json
|
|
185
|
+
~~~
|
|
186
|
+
|
|
187
|
+
Execute the second line only after successful preflight, scope review and authorization.
|
|
188
|
+
A partial patch can write a whole section and SAVE domains; write_count is not the
|
|
189
|
+
number of edited fields. Ordinary configuration checks RAM before SAVE and reads
|
|
190
|
+
back after SAVE. Neither proves power-cycle persistence. Never automatically restore
|
|
191
|
+
a previous backup after an uncertain write.
|
|
192
|
+
|
|
193
|
+
Adaptive enable must be a separate patch containing only selected
|
|
194
|
+
CANn_PARAMETER/BRT_AUTO:1 fields, with all channels initially unrestricted/manual.
|
|
195
|
+
It verifies flags only; adaptive_result remains not_verified. Do not export or write
|
|
196
|
+
back detected adaptive timings/placeholders for any role. Returning to manual needs
|
|
197
|
+
explicit new manual values for every channel.
|
|
198
|
+
|
|
199
|
+
## Change password
|
|
200
|
+
|
|
201
|
+
Extend the credential template to prompt separately for old/new values and set
|
|
202
|
+
CAN_PASSWORD/CAN_NEW_PASSWORD. Use different names. Clear both in finally/trap;
|
|
203
|
+
dispose both SecureString objects in PowerShell.
|
|
204
|
+
|
|
205
|
+
~~~console
|
|
206
|
+
canconfig change-password --port COM3 --expect-uid UID --password-env CAN_PASSWORD --new-password-env CAN_NEW_PASSWORD --dry-run --json
|
|
207
|
+
canconfig change-password --port COM3 --expect-uid UID --password-env CAN_PASSWORD --new-password-env CAN_NEW_PASSWORD --json
|
|
208
|
+
~~~
|
|
209
|
+
|
|
210
|
+
Dry-run checks identity and old authentication only; it does not change or SAVE.
|
|
211
|
+
Execute the second line only after reviewing preflight within authorization.
|
|
212
|
+
Success: verification.new_password=authenticated, readback=not_applicable.
|
|
213
|
+
A submitted timeout or failure authenticating the new password is not evidence that
|
|
214
|
+
the old password remains valid. Preserve results and stop automatic retries.
|
|
215
|
+
|
|
216
|
+
## Update firmware
|
|
217
|
+
|
|
218
|
+
Use the vendor's final .sfb package, not an encrypted .sfu intermediate:
|
|
219
|
+
SFU1/SFU2/SFU3 header, nonempty payload, at most 64 MiB.
|
|
220
|
+
Confirm model/image compatibility externally; file checks do not verify signatures.
|
|
221
|
+
Manually put the selected device into update mode; the CLI does not do this.
|
|
222
|
+
|
|
223
|
+
~~~console
|
|
224
|
+
canconfig firmware-update --port COM3 --file image.sfb --dry-run --json
|
|
225
|
+
canconfig firmware-update --port COM3 --file image.sfb --expect-sha256 HASH --expect-usb-serial SERIAL --timeout-ms 120000 --json
|
|
226
|
+
~~~
|
|
227
|
+
|
|
228
|
+
The first command is fully offline: no enumeration or serial I/O. Replace HASH with
|
|
229
|
+
its data.sha256. SERIAL means a confirmed USB serial; omit that option only if unavailable
|
|
230
|
+
and the explicit target port is confirmed. Execute only with target/image authorization.
|
|
231
|
+
Firmware accepts no configuration password/UID flags. It uses 115200 8N1, DTR on by
|
|
232
|
+
default; --no-dtr disables assertion.
|
|
233
|
+
|
|
234
|
+
Success requires verification.transfer=completed and device_return=observed.
|
|
235
|
+
Installed image/version/signature, compatibility and persistence remain unverified;
|
|
236
|
+
check the device afterwards using its documented procedure. Ymodem may retry numbered
|
|
237
|
+
packets; the CLI never restarts a whole session. On failure preserve phase/transfer/
|
|
238
|
+
device_return and inspect device state instead of automatically flashing again.
|
|
239
|
+
|
|
240
|
+
## Failure, interruption and cleanup
|
|
241
|
+
|
|
242
|
+
Default backend timeout is 120000 ms; --timeout-ms accepts 1–3600000 ms.
|
|
243
|
+
Python allows extra shutdown time. Ctrl+C requests cancellation. Without valid final
|
|
244
|
+
output, hardware effects are unknown; cancellation does not mean nothing happened.
|
|
245
|
+
After each task clear credentials. Restore operational mode or power-cycle only
|
|
246
|
+
within the device procedure and task authorization.
|
|
247
|
+
|
|
248
|
+
| Exit | Meaning | First action |
|
|
249
|
+
|---|---|---|
|
|
250
|
+
| 0 | Completed | Inspect remaining verification gaps |
|
|
251
|
+
| 1 | Connection/runtime/lock | Doctor, explicit port, permissions, other applications |
|
|
252
|
+
| 2 | Authentication/format | Check variable availability/byte length without printing secrets |
|
|
253
|
+
| 3 | File I/O | Check path/access, stop dependent operations |
|
|
254
|
+
| 4 | Communication/protocol | Preserve result, check connection/runtime |
|
|
255
|
+
| 5 | Unsupported | Check platform/model/capabilities |
|
|
256
|
+
| 6 | Identity | Stop and compare target/file UID |
|
|
257
|
+
| 7 | Configuration/JSON | Correct the indicated field and preflight again |
|
|
258
|
+
| 8 | Unknown hardware result | Stop automatic retry/rollback; inspect actual state |
|
|
259
|
+
| 9 | Usage | COMMAND --help; errors do not echo possibly secret arguments |
|
|
260
|
+
| 10 | Readback mismatch | Stop and preserve effects/verification |
|
|
261
|
+
| 11 | Timeout | Inspect effects before any decision |
|
|
262
|
+
| 12 | Cancelled | Inspect effects; do not assume no execution |
|
|
263
|
+
|
|
264
|
+
Offline validation, fake-driver tests, installed-package checks and physical-device
|
|
265
|
+
acceptance are distinct evidence. This release does not automatically retry
|
|
266
|
+
configuration, roll back, or prove persistence after power loss.
|
|
267
|
+
|
|
268
|
+
## Licenses and native source
|
|
269
|
+
|
|
270
|
+
The Python wrapper is MIT. The bundled Console includes XinLi's GPL-3.0-or-later
|
|
271
|
+
Ymodem implementation; Qt and compiler libraries retain their own licenses.
|
|
272
|
+
`canconfig docs export --output ./canconfig-docs` also exports `native-source.tar.gz`.
|
|
273
|
+
Extract it and follow DEVELOPING.md to rebuild the native programs. See its
|
|
274
|
+
THIRD_PARTY_NOTICES.md for license materials and dependency source locations.
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
# CANConfigPython 用户操作说明
|
|
2
|
+
|
|
3
|
+
适用版本:Python CLI 0.1.0a1 / Console 2.3 / bridge API 1。
|
|
4
|
+
Windows 和 Linux 使用相同命令。Linux 包的实测状态以发布包附带的验证记录为准。
|
|
5
|
+
本工具面向 CANHub、CANFB、CANBridge、CANRPT、CANCOM 配置,不提供 CAN 报文发送功能。
|
|
6
|
+
|
|
7
|
+
## 1. 安装与第一次成功运行
|
|
8
|
+
|
|
9
|
+
在保存发布文件的目录打开 PowerShell 或 Linux 终端。需要 Python 3.8 或以上。
|
|
10
|
+
建议创建虚拟环境;运行时无需单独安装 Qt、WIICAN 或 GUI。
|
|
11
|
+
|
|
12
|
+
Windows PowerShell(按实际 wheel 文件名替换):
|
|
13
|
+
~~~powershell
|
|
14
|
+
python -m venv .venv
|
|
15
|
+
.\.venv\Scripts\python.exe -m pip install .\canconfigpython-0.1.0a1-py3-none-win_amd64.whl
|
|
16
|
+
.\.venv\Scripts\canconfig.exe doctor --json
|
|
17
|
+
~~~
|
|
18
|
+
|
|
19
|
+
Linux x86_64(需要 glibc 2.38 或以上,已在 Ubuntu 24.04 / Python 3.12 上验证):
|
|
20
|
+
~~~bash
|
|
21
|
+
python3 -m venv .venv
|
|
22
|
+
. .venv/bin/activate
|
|
23
|
+
python -m pip install ./canconfigpython-0.1.0a1-py3-none-manylinux_2_38_x86_64.manylinux_2_39_x86_64.whl
|
|
24
|
+
canconfig doctor --json
|
|
25
|
+
~~~
|
|
26
|
+
|
|
27
|
+
可用 `ldd --version` 查看 glibc 版本。当前 Linux 包不适用于低于 2.38 的 glibc、ARM64 或 musl 系统。
|
|
28
|
+
安装成功后可激活环境,或使用其完整可执行文件路径。后续以 canconfig 简写。
|
|
29
|
+
已上传 PyPI 后才可以使用 `python -m pip install --pre CANConfigPython`。
|
|
30
|
+
升级用 `python -m pip install --upgrade --pre CANConfigPython`;
|
|
31
|
+
卸载用 `python -m pip uninstall CANConfigPython`。备份和已导出的说明/Skill 不会被卸载删除。
|
|
32
|
+
|
|
33
|
+
~~~console
|
|
34
|
+
canconfig --version --json
|
|
35
|
+
canconfig doctor --json
|
|
36
|
+
canconfig schema --json
|
|
37
|
+
canconfig apply --help
|
|
38
|
+
canconfig docs export --output ./canconfig-docs
|
|
39
|
+
canconfig skill export --output ./canconfig-skill
|
|
40
|
+
~~~
|
|
41
|
+
|
|
42
|
+
doctor 成功应有 exit_code=0、ok=true、data.device_opened=false;
|
|
43
|
+
它检查运行包哈希、后端版本、动态库和必要函数,不发现或打开设备。
|
|
44
|
+
schema 返回说明性契约,不是可直接套用的 JSON Schema 或配置文件。
|
|
45
|
+
docs/skill export 只接受不存在的目录,避免覆盖已有文件。
|
|
46
|
+
Skill 的入口是导出目录中的 SKILL.md,可将整个目录复制到所用 Agent 的技能目录;
|
|
47
|
+
不要只复制 SKILL.md 而丢弃 references/assets。安装 Python 包不会自动修改 Agent 设置。
|
|
48
|
+
|
|
49
|
+
若提示 runtime_invalid/runtime_load_failed,重新安装匹配平台的完整 wheel。
|
|
50
|
+
不要从其他 GUI 目录随意复制 DLL/SO 混用。修改运行库的开发者参见项目构建说明。
|
|
51
|
+
|
|
52
|
+
## 2. 选择目标和理解输出
|
|
53
|
+
|
|
54
|
+
每个命令都显式指定端口。Windows 用 COM3;Linux 用 /dev/ttyACM0,
|
|
55
|
+
优先使用已确认设备的 /dev/serial/by-id/... 稳定别名。Linux 区分大小写。
|
|
56
|
+
|
|
57
|
+
Linux 可用 `ls -l /dev/serial/by-id/`、`ls -l /dev/ttyACM0` 和 `id`
|
|
58
|
+
核对设备及权限。若设备组为 dialout,可由系统管理员把当前用户加入该组,
|
|
59
|
+
重新登录后重试;不同发行版组名可能不同。不要将设备改为全员可写,也不默认用 sudo。
|
|
60
|
+
同一端口应只由一个配置程序使用;本工具的锁只约束同用户的 CANConfigPython 进程。
|
|
61
|
+
|
|
62
|
+
~~~console
|
|
63
|
+
canconfig info --port COM3 --json
|
|
64
|
+
~~~
|
|
65
|
+
|
|
66
|
+
Linux 将 COM3 换成确认的 /dev 路径。核对 data.device.uid、type、hardware、firmware
|
|
67
|
+
和 capabilities。info 不提供完整当前配置,writable_fields 仅列字段名,不保证当前状态可写。
|
|
68
|
+
即使是 info 或配置 dry-run,连接也可能改变设备运行模式,应在允许维护的条件下使用。
|
|
69
|
+
|
|
70
|
+
所有操作输出 UTF-8 JSON;--json 压缩为一行,便于程序读取。
|
|
71
|
+
同时检查进程退出码、ok、effects、verification,不能只检查“程序有输出”。
|
|
72
|
+
|
|
73
|
+
- effects.attempted/submitted/acknowledged/save_acknowledged:尝试、已提交、已确认及 SAVE 确认数。
|
|
74
|
+
- effects.status=none:该结果没有配置写入;并不承诺连接没有改变运行模式。
|
|
75
|
+
- applied/transferred:所述配置操作或固件传输完成,仍应检查 verification。
|
|
76
|
+
- partial/unknown:部分发生或无法确定。立即停止自动重试/回滚。
|
|
77
|
+
- Python 无法取得有效最终结果时,计数可能为 null,表示未知,不是 0。
|
|
78
|
+
- readback=matched 证明此次回读匹配;power_cycle=not_verified 表示未验证断电保持。
|
|
79
|
+
|
|
80
|
+
PowerShell 5.1 捕获并解析 JSON 时,在 try 中设置
|
|
81
|
+
`[Console]::OutputEncoding = New-Object System.Text.UTF8Encoding($false)`,
|
|
82
|
+
finally 恢复原值。原生退出码用 $LASTEXITCODE;Linux 用 $?,必须在运行命令后立即读取。
|
|
83
|
+
|
|
84
|
+
## 3. 准备密码,保留失败信息
|
|
85
|
+
|
|
86
|
+
密码为 1–10 个 UTF-8 字节,不能含 NUL。中文字符通常占多个字节。
|
|
87
|
+
CLI 只接受环境变量名,不接受明文 --password。不要把密码写进命令、脚本或聊天。
|
|
88
|
+
临时环境变量仍可能被本机管理员读取;它不是密码保险箱。
|
|
89
|
+
|
|
90
|
+
PowerShell 完整模板(按本次任务替换 try 中的那一条命令):
|
|
91
|
+
~~~powershell
|
|
92
|
+
$originalEncoding = [Console]::OutputEncoding
|
|
93
|
+
$secure = Read-Host '设备密码' -AsSecureString
|
|
94
|
+
try {
|
|
95
|
+
[Console]::OutputEncoding = New-Object System.Text.UTF8Encoding($false)
|
|
96
|
+
$env:CAN_PASSWORD = [System.Net.NetworkCredential]::new('', $secure).Password
|
|
97
|
+
$raw = canconfig export --port COM3 --file .\backup-new.ini --password-env CAN_PASSWORD --expect-uid '从已核对设备复制完整UID' --json
|
|
98
|
+
$exitCode = $LASTEXITCODE
|
|
99
|
+
$result = $raw | ConvertFrom-Json
|
|
100
|
+
$result | ConvertTo-Json -Depth 20
|
|
101
|
+
if ($exitCode -ne 0 -or -not $result.ok) { throw '操作失败;检查 effects 和 verification,停止自动重试。' }
|
|
102
|
+
}
|
|
103
|
+
finally {
|
|
104
|
+
Remove-Item Env:CAN_PASSWORD -ErrorAction SilentlyContinue
|
|
105
|
+
$secure.Dispose()
|
|
106
|
+
[Console]::OutputEncoding = $originalEncoding
|
|
107
|
+
}
|
|
108
|
+
~~~
|
|
109
|
+
|
|
110
|
+
示例中的端口、文件和 UID 必须替换成已确认值。将成功和失败的 JSON 保存为任务记录,
|
|
111
|
+
其中可能包含设备 UID/配置;分享前按需要处理这些业务信息。
|
|
112
|
+
|
|
113
|
+
Linux Bash 模板:
|
|
114
|
+
~~~bash
|
|
115
|
+
(
|
|
116
|
+
trap 'unset CAN_PASSWORD' EXIT
|
|
117
|
+
read -r -s -p '设备密码: ' CAN_PASSWORD
|
|
118
|
+
printf '\n'
|
|
119
|
+
export CAN_PASSWORD
|
|
120
|
+
canconfig export --port /dev/ttyACM0 --file ./backup-new.ini \
|
|
121
|
+
--password-env CAN_PASSWORD --expect-uid '从已核对设备复制完整UID' --json
|
|
122
|
+
rc=$?
|
|
123
|
+
if [ "$rc" -ne 0 ]; then
|
|
124
|
+
printf '操作失败,检查结果后停止自动重试。\n' >&2
|
|
125
|
+
exit "$rc"
|
|
126
|
+
fi
|
|
127
|
+
)
|
|
128
|
+
~~~
|
|
129
|
+
|
|
130
|
+
后续所有需要密码的命令,都放在上述模板 try/子 Shell 内执行,确保任何失败路径都清理密码。
|
|
131
|
+
|
|
132
|
+
## 4. 导出、验证和恢复备份
|
|
133
|
+
|
|
134
|
+
备份为 INI 文件;JSON 补丁不能用 validate 验证。
|
|
135
|
+
导出会替换已有目标文件,使用新的、可识别设备和时间的文件名。
|
|
136
|
+
|
|
137
|
+
~~~console
|
|
138
|
+
canconfig export --port COM3 --file backup-new.ini --password-env CAN_PASSWORD --expect-uid UID --json
|
|
139
|
+
canconfig validate --file backup-new.ini --json
|
|
140
|
+
canconfig restore --port COM3 --file backup-new.ini --password-env CAN_PASSWORD --expect-uid UID --check-device --dry-run --json
|
|
141
|
+
~~~
|
|
142
|
+
|
|
143
|
+
UID 是本次已确认目标 UID,不要直接输入“UID”。
|
|
144
|
+
export 成功后核对 data.file 与 data.complete;validate 离线检查文件规则,不连接设备。
|
|
145
|
+
restore --dry-run 会连接、检查身份和现有状态,但不发 SET/WRITE/SAVE。
|
|
146
|
+
检查 fields、write_count、save_domains 与预期一致后,在已有操作授权范围内去掉
|
|
147
|
+
--dry-run 执行相同命令。恢复成功要求 ok=true 且 verification.readback=matched。
|
|
148
|
+
|
|
149
|
+
只处理部分配置时,在 export、validate、restore 上使用相同的 --sections 列表。
|
|
150
|
+
可选:parameters、filters、filter_mode、mapping、options、routing、cancom、user_data,
|
|
151
|
+
用逗号连接;默认 all 表示所有支持段。明确选择不支持的段会报错。
|
|
152
|
+
|
|
153
|
+
--expect-uid 固定当前目标;--check-device 同时要求备份属于该设备。
|
|
154
|
+
跨设备迁移须明确确认兼容性和迁移范围,才省略 --check-device;仍固定目标 UID。
|
|
155
|
+
身份不匹配时不要自动改备份 UID。导出受自适应/只读限制失败时,不要擅自切换模式取备份。
|
|
156
|
+
|
|
157
|
+
## 5. 用 JSON 修改参数
|
|
158
|
+
|
|
159
|
+
先导出 Skill,按 assets/examples/index.zh-CN.md 选择匹配型号/版本的例子。
|
|
160
|
+
复制到工作目录,依据已确认目标填入例子的全零 UID,再编辑授权字段。
|
|
161
|
+
既有请求的非零 UID 不匹配时停止,不自动替换。
|
|
162
|
+
|
|
163
|
+
下例仅用于说明 CANBridge 的结构;时序值取决于型号/通道,不能通用套用:
|
|
164
|
+
~~~json
|
|
165
|
+
{
|
|
166
|
+
"schema_version": 1,
|
|
167
|
+
"device_uid": "0000-0000-0000-0000-0000-0000",
|
|
168
|
+
"changes": {
|
|
169
|
+
"CAN1_PARAMETER/BRT": [500000, 1, 13, 2]
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
~~~
|
|
173
|
+
|
|
174
|
+
文件必须是无 BOM 的 UTF-8,字段区分大小写;不能加 $schema、重复键、注释或 NaN。
|
|
175
|
+
Windows PowerShell 5.1 不用 > 创建 JSON,使用明确的 UTF-8 无 BOM 写入方法:
|
|
176
|
+
~~~powershell
|
|
177
|
+
[IO.File]::WriteAllText((Join-Path $PWD 'changes.json'), $jsonText, (New-Object Text.UTF8Encoding($false)))
|
|
178
|
+
~~~
|
|
179
|
+
|
|
180
|
+
$jsonText 必须是本次成功构造/编辑的 JSON 文本;文件生成或转换失败即停止。
|
|
181
|
+
包装层严格解析并生成临时快照,防止校验与执行读取到不同 JSON。设备规则由 Console 检查。
|
|
182
|
+
|
|
183
|
+
~~~console
|
|
184
|
+
canconfig apply --port COM3 --file changes.json --password-env CAN_PASSWORD --expect-uid UID --dry-run --json
|
|
185
|
+
canconfig apply --port COM3 --file changes.json --password-env CAN_PASSWORD --expect-uid UID --json
|
|
186
|
+
~~~
|
|
187
|
+
|
|
188
|
+
第二条只在第一条成功、预检范围已核对且操作已获授权时执行。
|
|
189
|
+
局部字段修改可能写整个配置段,并保存相应域;write_count 不是字段数。
|
|
190
|
+
普通配置会在 SAVE 前回读 RAM、SAVE 后再次回读;这仍不能证明断电保持。
|
|
191
|
+
不要把恢复旧备份当作失败后的自动回滚。
|
|
192
|
+
|
|
193
|
+
自适应模式:开启须单独提交只有 CANn_PARAMETER/BRT_AUTO:1 的补丁,
|
|
194
|
+
所有通道起始为可完整读取的手动参数。验证只确认模式标志,
|
|
195
|
+
adaptive_result 仍为 not_verified。检测得到的时序/占位值不能导出或写回;
|
|
196
|
+
切回手动须明确提供全部通道的新手动参数,不与开启操作混在一起。
|
|
197
|
+
|
|
198
|
+
## 6. 修改密码
|
|
199
|
+
|
|
200
|
+
使用不同变量名保存旧/新密码;两者均遵守 1–10 UTF-8 字节限制。
|
|
201
|
+
扩展第 3 节模板:分别隐藏输入两次,设置 CAN_PASSWORD 与 CAN_NEW_PASSWORD;
|
|
202
|
+
finally/trap 清理两个变量,PowerShell 同时 Dispose 两个 SecureString。
|
|
203
|
+
|
|
204
|
+
~~~console
|
|
205
|
+
canconfig change-password --port COM3 --expect-uid UID --password-env CAN_PASSWORD --new-password-env CAN_NEW_PASSWORD --dry-run --json
|
|
206
|
+
canconfig change-password --port COM3 --expect-uid UID --password-env CAN_PASSWORD --new-password-env CAN_NEW_PASSWORD --json
|
|
207
|
+
~~~
|
|
208
|
+
|
|
209
|
+
dry-run 只核对身份和旧密码,不修改、不 SAVE。核对成功后才按授权执行第二条。
|
|
210
|
+
成功看 verification.new_password=authenticated;readback=not_applicable。
|
|
211
|
+
若提交后超时、ACK 后新密码认证失败,保留结果并停止重试,不能断言旧密码仍有效。
|
|
212
|
+
|
|
213
|
+
## 7. 固件更新
|
|
214
|
+
|
|
215
|
+
使用厂家最终 .sfb 包,不使用加密中间文件 .sfu。支持 SFU1/SFU2/SFU3 头、
|
|
216
|
+
有负载且不超过 64 MiB。文件格式匹配不证明型号兼容或签名可信。
|
|
217
|
+
外部确认设备型号与固件匹配,并手动让目标设备进入升级模式;CLI 不自动进入。
|
|
218
|
+
|
|
219
|
+
~~~console
|
|
220
|
+
canconfig firmware-update --port COM3 --file image.sfb --dry-run --json
|
|
221
|
+
canconfig firmware-update --port COM3 --file image.sfb --expect-sha256 HASH --expect-usb-serial SERIAL --timeout-ms 120000 --json
|
|
222
|
+
~~~
|
|
223
|
+
|
|
224
|
+
第一条完全离线:不枚举、不打开串口。核对 data.sha256 后,将 HASH 替换为该值。
|
|
225
|
+
SERIAL 是已确认的 USB 序列号;设备不提供且用户确认显式端口时省略该选项。
|
|
226
|
+
第二条会下载固件,只在目标和固件已获授权后执行。
|
|
227
|
+
固件模式不接受配置密码/UID;传输为 115200 8N1,默认置 DTR,可用 --no-dtr 关闭。
|
|
228
|
+
|
|
229
|
+
成功需 verification.transfer=completed、device_return=observed;
|
|
230
|
+
installed_firmware、compatibility 等仍为 not_verified。还需按设备流程检查实际版本。
|
|
231
|
+
Ymodem 可以重发编号数据包,但 CLI 不重新开始整个会话。
|
|
232
|
+
失败或中断时保留 phase/transfer/device_return、检查设备当前升级状态,禁止自动重刷。
|
|
233
|
+
|
|
234
|
+
## 8. 故障处理和退出码
|
|
235
|
+
|
|
236
|
+
默认后端期限 120000 ms;--timeout-ms 为 1–3600000 ms。Python 留出额外关闭时间。
|
|
237
|
+
Ctrl+C 请求中断;如果后端不能返回最终结果,显示 unknown,不能视为未写入。
|
|
238
|
+
执行完成后关闭连接,清理密码变量。恢复业务运行模式/断电重启应依设备流程和任务授权进行。
|
|
239
|
+
|
|
240
|
+
| 退出码 | 意义 | 首先处理 |
|
|
241
|
+
|---|---|---|
|
|
242
|
+
| 0 | 操作完成 | 继续检查 verification 未验证项 |
|
|
243
|
+
| 1 | 连接、运行库、端口锁 | 检查 doctor、明确端口、权限、其他占用程序 |
|
|
244
|
+
| 2 | 认证/密码格式 | 检查变量是否存在及字节长度,不打印密码 |
|
|
245
|
+
| 3 | 文件 I/O | 检查路径/权限,导出选新目录,停止后续写操作 |
|
|
246
|
+
| 4 | 通信或输出协议 | 保留结果,检查连接和运行包版本 |
|
|
247
|
+
| 5 | 不支持 | 核对平台、型号和能力 |
|
|
248
|
+
| 6 | 身份不符 | 停止,核对目标与文件 UID |
|
|
249
|
+
| 7 | 配置/JSON 不合法 | 根据 error.field 修改本次请求后重新预检 |
|
|
250
|
+
| 8 | 硬件结果未知 | 停止自动重试/回滚,人工确认现状 |
|
|
251
|
+
| 9 | 用法错误 | 查看 COMMAND --help;错误不回显可能含密码的参数 |
|
|
252
|
+
| 10 | 回读不匹配 | 停止,保留 effects 和 verification |
|
|
253
|
+
| 11 | 超时 | 先判断 effects,不按超时自动重试 |
|
|
254
|
+
| 12 | 取消 | 先判断 effects,不假设未执行 |
|
|
255
|
+
|
|
256
|
+
本版不自动重试配置操作、不自动回滚、不证明断电保存。离线检查、假驱动测试、
|
|
257
|
+
安装验证与真实设备验收属于不同证据,不能互相替代。
|
|
258
|
+
|
|
259
|
+
## 许可证与原生源码
|
|
260
|
+
|
|
261
|
+
Python 包装层采用 MIT。随包 Console 包含 XinLi 的 GPLv3-or-later Ymodem
|
|
262
|
+
实现,保留其许可证;Qt 和编译器运行库也保留各自许可证。
|
|
263
|
+
`canconfig docs export --output ./canconfig-docs` 会一起导出
|
|
264
|
+
`native-source.tar.gz`。解压后按其中的 DEVELOPING.md 重建原生程序,
|
|
265
|
+
THIRD_PARTY_NOTICES.md 列出了许可和外部依赖的源码位置。
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: canconfig-python
|
|
3
|
+
description: Use CANConfigPython on Windows or Linux to inspect CAN device identity, export or restore INI backups, apply JSON configuration, change passwords, or update firmware on an explicit serial port. Use for CLI operations and troubleshooting, not CAN traffic generation or firmware development.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# CANConfigPython device operations
|
|
7
|
+
|
|
8
|
+
Read [the operation reference](references/operations.md) for the selected task.
|
|
9
|
+
For parameter edits, select a device-specific request from
|
|
10
|
+
[the example catalog](assets/examples/index.en.md) or
|
|
11
|
+
[中文用例目录](assets/examples/index.zh-CN.md), using
|
|
12
|
+
[changes.schema.json](assets/changes.schema.json) for offline structure checks.
|
|
13
|
+
|
|
14
|
+
## Identify and prepare
|
|
15
|
+
|
|
16
|
+
1. Run `canconfig --version --json` and `canconfig doctor --json`. This Skill targets
|
|
17
|
+
Python 0.1.0a1, Console 2.3, bridge API 1. Doctor opens no device.
|
|
18
|
+
2. Use the user-selected explicit COM port on Windows or /dev path on Linux.
|
|
19
|
+
Query info when authorized to connect. It returns identity, capabilities and field
|
|
20
|
+
names, not a complete current configuration. Info/configuration dry-run can
|
|
21
|
+
change device run mode.
|
|
22
|
+
3. Match UID, model and capabilities to the task. Ask only for missing target/scope;
|
|
23
|
+
existing authorization remains valid. Prepare a concrete reviewable request
|
|
24
|
+
before any additional approval that is actually required.
|
|
25
|
+
4. Copy a suitable example. Only replace its all-zero placeholder UID using the
|
|
26
|
+
confirmed target. A mismatch in an existing request/backup is a stop condition,
|
|
27
|
+
not permission to rewrite it. Change only authorized fields. A partial patch may
|
|
28
|
+
write an entire section and associated SAVE domains.
|
|
29
|
+
|
|
30
|
+
## Execute and interpret
|
|
31
|
+
|
|
32
|
+
- Use UTF-8 JSON without BOM containing exactly schema_version, device_uid and
|
|
33
|
+
changes. Python rejects duplicate keys and nonfinite numbers. Stop on preparation
|
|
34
|
+
errors; do not accidentally apply a previous file. Schema/results are envelopes,
|
|
35
|
+
not patch files. Validate accepts INI backups only.
|
|
36
|
+
- Pass credentials through short-lived environment variables (--password-env);
|
|
37
|
+
the API accepts in-memory passwords. Never pass secrets in argv, logs, committed
|
|
38
|
+
files, reports or chat. Clear caller variables in finally/trap paths covering
|
|
39
|
+
preparation, invocation and result parsing.
|
|
40
|
+
- For configuration writes, run the matching live dry-run, inspect its scope, then
|
|
41
|
+
execute the unchanged request within existing authorization. A dry-run is not a
|
|
42
|
+
reservation; execution repeats preflight.
|
|
43
|
+
- Check process exit, ok, effects and verification. On partial/unknown effects,
|
|
44
|
+
timeout, cancellation, mismatch or missing final JSON, stop automatic retry and
|
|
45
|
+
rollback; report known effects and uncertainty. Missing output means counts can
|
|
46
|
+
be null, not zero. Do not infer power-cycle persistence.
|
|
47
|
+
|
|
48
|
+
## Device-specific boundaries
|
|
49
|
+
|
|
50
|
+
- Adaptive enable must be a separate patch containing only selected
|
|
51
|
+
CANn_PARAMETER/BRT_AUTO: 1 fields. All channels must initially have unrestricted
|
|
52
|
+
manual parameters. It verifies flags only, not detected baud rate.
|
|
53
|
+
- Never export/write back adaptive detected timings/placeholders for any role.
|
|
54
|
+
Do not disable adaptive merely to get a backup. Returning to manual requires
|
|
55
|
+
explicitly authorized new manual parameters for every channel.
|
|
56
|
+
- Same-device restore uses --expect-uid and --check-device. Cross-device migration
|
|
57
|
+
requires explicit scope; retain target --expect-uid, omit --check-device only for
|
|
58
|
+
that authorized migration.
|
|
59
|
+
- Password change requires explicit UID and distinct old/new environment names.
|
|
60
|
+
Dry-run authenticates the old password without changing it. Success confirms one
|
|
61
|
+
new-password authentication, not persistence after power cycle.
|
|
62
|
+
- Firmware .sfb dry-run is offline. Pin SHA-256, confirm external model/image
|
|
63
|
+
compatibility and that the selected device is already in update mode. Do not add
|
|
64
|
+
configuration UID/password flags. Transmission plus port return does not prove
|
|
65
|
+
installed version, signature, compatibility or power-cycle behavior.
|
|
66
|
+
|
|
67
|
+
## Report
|
|
68
|
+
|
|
69
|
+
State target, scope, actual effects/verification and needed next action.
|
|
70
|
+
Distinguish simulated/offline checks from physical-device validation.
|
|
71
|
+
Do not disclose passwords or adaptive detected timings.
|