blob: 09711e6151026be9f881955c580a1d1a20cd7124 [file] [log] [blame]
#!/bin/sh
. /etc/utils.sh
if ! interface_exists quantenna; then
echo "No Quantenna device."
exit 0
fi
bbic_temp_file=/tmp/gpio/aux1_temperature
while :; do
temp=$(
qcsapi get_temperature | while read n e v; do
if [ "$n" = temperature_bbic_internal ]; then
echo $v
fi
done
)
if [ -z "$temp" ]; then
atomic "$bbic_temp_file" "-1"
echo "accessing bbic failed."
sleep 5
continue
fi
# The string returned is
# temperature_bbic_internal = 55.0
# This line of code strips off the prefix and leaves the temperature value.
temp=${temp#*= }
echo "bbic temp=$temp"
if [ -n "$temp" ]; then
atomic "$bbic_temp_file" "$temp"
else
echo "accessing bbic returned empty temperature string."
atomic "$bbic_temp_file" "-1"
fi
sleep 5
done