Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce CAN Bus support #3802

Merged
merged 5 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
395 changes: 395 additions & 0 deletions docs/CANBus.md

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/DEVICE-CONNECTIVITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ the edge-node, not globally.
### Physical network ports

EVE supports ethernet NICs, WiFi modules and cellular modems.
Support for [CAN devices is a work in-progress](https://wiki.lfedge.org/display/EVE/CAN+Bus+support).

Physical network IO devices are listed as part of the device model. This should include
all devices that will be used by EVE (for management) or by applications (directly or shared).
Expand Down
Binary file added docs/images/eve-can-case1-model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/eve-can-case1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/eve-can-case2-model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/eve-can-case2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/eve-can-case3-model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/eve-can-case3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/mkdocs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ nav:
- 'Verifying EVE-OS': 'docs/HARDWARE-VERIFICATION.md'
- 'Booting EVE': 'docs/BOOTING.md'
- Communications: 'docs/COMMS.md'
- 'CAN Bus': 'docs/CANBus.md'
- Registration: 'docs/REGISTRATION.md'
- 'Update base image': 'docs/BASEIMAGE-UPDATE.md'
- Build-tools: 'build-tools/ver-update/README.md'
Expand Down
24 changes: 24 additions & 0 deletions pkg/debug/spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,30 @@ __EOT__
COMMA="},"
fi
done
#enumerate physical CAN devices
for CAN in /sys/class/net/*; do
TYPE=$(cat "${CAN}/type")
if [ "$TYPE" != 280 ]; then
continue
fi
ZTYPE="IO_TYPE_CAN"
IFNAME=$(basename "${CAN}")
cat <<__EOT__
${COMMA}
{
"ztype": ${ZTYPE},
"phylabel": "${IFNAME}",
"phyaddrs": {
"Ifname": "${IFNAME}"
rene marked this conversation as resolved.
Show resolved Hide resolved
},
"logicallabel": "${IFNAME}",
"assigngrp": "",
"cbattr": {
"bitrate": "150000"
}
__EOT__
COMMA="},"
done
#enumerate Audio
ID=""
for audio in $(echo "$LSPCI_D" | grep Audio | cut -f1 -d\ ); do
Expand Down
Loading
Loading