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 <[email protected]>
  • Loading branch information
rene committed Mar 11, 2024
1 parent 51bce46 commit ac86d4f
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 @@ -528,6 +528,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 ac86d4f

Please sign in to comment.