Skip to content

Commit

Permalink
spec.sh: List physical CAN interfaces
Browse files Browse the repository at this point in the history
Add the capability to list physical CAN interfaces.

Signed-off-by: Renê de Souza Pinto <rene@renesp.com.br>
  • Loading branch information
rene authored and eriknordmark committed Mar 17, 2024
1 parent ef238d9 commit 2c42bfc
Showing 1 changed file with 24 additions and 0 deletions.
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}"
},
"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

0 comments on commit 2c42bfc

Please sign in to comment.