#!/bin/sh # B10A read-only trend: every 30 s read BMS FIFO/status, CHGR/BAT_IF/USB RT_STS, VADC last data. Reads only. R=/sys/kernel/debug/regmap/0-00/registers rd() { dd if=$R bs=9 skip=$(($1)) count=$2 2>/dev/null | cut -d' ' -f2 | tr '\n' ' '; } i=0 while [ $i -lt ${1:-10} ]; do echo "T $(cut -d' ' -f1 /proc/uptime) bms08=$(rd 0x4008 2) fifo=$(rd 0x40c0 10) ocv=$(rd 0x406a 2) chg09=$(rd 0x1009 1) chgrt=$(rd 0x1010 1) batrt=$(rd 0x1210 1) usbrt=$(rd 0x1310 1) vadc=$(rd 0x3160 2) ch=$(rd 0x3148 1) temps=$(cat /sys/class/thermal/thermal_zone*/temp | tr '\n' ' ')" i=$((i+1)); sleep 30 done echo B10A-TREND-END