#!/bin/bash

source pvi_test.sh
source icm20602.sh
source get-cpu-temp.sh
source get-sata-reg-val.sh
source get-sata-state.sh
source get-sata-err-log.sh


function collect_single() {
pvi_temp_get pviTemp
pvi_current_get Isource
pvi_volt_get Vdd
pvi_pratio_get Psource

temp_get  icmTemp
accel_get AccelX AccelY AccelZ
gyro_get  GyroX  GyroY  GyroZ 

cpu_temp_get TempCpu0 TempCpu1

echo -e "I: ${Isource}    V: ${Vdd}    P: ${Psource}    T: ${pviTemp}\n"
echo -e "AccelX: ${AccelX}\tAccelY: ${AccelY}\tAccelZ: ${AccelZ}\tT: ${icmTemp}"
echo -e "GyroX : ${GyroX}\tGyroY : ${GyroY}\tGyroZ : ${GyroZ}\n"
echo -e "TempCpu0: ${TempCpu0}\tTempCpu1: ${TempCpu1}\n"

for arg in $*
do
echo -e "${arg} collect information:"
sata_reg_val_get ${arg}
ST=`sata_health_get ${arg}`
echo "SataHealthSt: ${ST}"
sata_err_log_get ${arg}      
done
}

SataName="/dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde"

pvi_init
icm20602_init

collect_single ${SataName}




 
