Intel MPCBL0001 Personal Computer User Manual


 
Technical Product Specification 79
Order #273817
Intel NetStructure
®
MPCBL0001 High Performance Single Board Computer
Contents
if [ $# -ne 1 ]; then
PrintUsage
fi
LOC=$1 # Location to read from
SEL_FILENAME="$LOC.txt"
echo
echo "Serial Buffer from $LOC will be saved as $SEL_FILENAME"
echo
rm -f $SEL_FILENAME
declare val
OFFSET_LSB=0
OFFSET_MSB=0
TOTAL_BYTES=0
while true; do
# Read some bytes
val=(`cmmset -l $LOC -d ipmicommand -v "0x30 0x30 0 $OFFSET_LSB $OFFSET_MSB"`)
# If no bytes were read, it is an error
if [ "${#val}" -eq "0" ]; then
echo "Error accessing $LOC"
exit 1
elif [ "${val[0]}" -eq "0" ]; then
if [ "${val[1]}" -eq "0" ]; then
# No more bytes to read. Finished.
echo ""
echo "Read $TOTAL_BYTES bytes of Serial Buffer"
exit 0
fi
# Output a dot to show progress
echo -n "."
# Output the data bytes as ASCII characters
# skipping the first 2 bytes (comp code and length)
OutAscii 2 ${val[*]} >> $SEL_FILENAME
# Increment the offset bytes
lsb=$(( $OFFSET_LSB + ${val[1]} ))
OFFSET_MSB=$(( $OFFSET_MSB + ( $lsb / 256 ) ))
OFFSET_LSB=$(( $lsb % 256 ))
TOTAL_BYTES=$(( $TOTAL_BYTES + ${val[1]} ))
else
# Completion Code non-0.
echo
echo "Error: Completion Code `DecToHex ${val[0]}`h received"
exit 1
fi
done
echo
# ***** end of file *****