#!/bin/bash

. /tmp/cmdline
. /usr/bin/i2csetup

if [ -z "$(which i2cutil)" ] ; then
    logger i2crdbox "i2cutil not found"
    echo ''
    exit 1
else
    #read only first card found
    for BUS in ${I2CCONFIGBUS};do 
        temp=$(i2cutil -y -r ${BUS} ${I2CCONFIGADDRESS} 0 bl)
        rc=$?
        t=$(printf "%08x" ${temp})
        echo ${t:4:4}
        exit $rc
    done
fi

