Files
BionxControl/doc/dummy.c

129 lines
5.6 KiB
C

hwVersion = getValue(CONSOLE, CONSOLE_REF_HW);
" assistance level ........: %d"
getValue(CONSOLE, CONSOLE_ASSIST_INITLEVEL)
printf( " part number .............: %05d" ((getValue(CONSOLE, CONSOLE_SN_PN_HI) << 8) + getValue(CONSOLE, CONSOLE_SN_PN_LO)),
" item number .............: %05d" ((getValue(CONSOLE, CONSOLE_SN_ITEM_HI) << 8) + getValue(CONSOLE, CONSOLE_SN_ITEM_LO))
/* ASSIST speed limit */
max limit enabled sl = getValue(CONSOLE, CONSOLE_ASSIST_MAXSPEEDFLAG) == 0 ? "no" : "yes";
speed limit speedLimit = ((getValue(CONSOLE, CONSOLE_ASSIST_MAXSPEED_HI) << 8) + getValue(CONSOLE, CONSOLE_ASSIST_MAXSPEED_LO)) / (double)10;
/* MIN speed limit */
sl = getValue(CONSOLE, CONSOLE_ASSIST_MINSPEEDFLAG) == 0 ? "no" : "yes";
speedLimit = (getValue(CONSOLE, CONSOLE_ASSIST_MINSPEED)) / (double)10;
/* THROTTLE speed limit */
" throttle limit enabled ..: %sl = getValue(CONSOLE, CONSOLE_THROTTLE_MAXSPEEDFLAG) == 0 ? "no" : "yes";
" throttle limit enabled ..: %s" = ((getValue(CONSOLE, CONSOLE_THROTTLE_MAXSPEED_HI) << 8) + getValue(CONSOLE, CONSOLE_THROTTLE_MAXSPEED_LO)) / (double)10;
printf( " throttle limit enabled ..: %s" _NL
" throttle speed limit ....: %0.2f Km/h" _NL _NL, sl, speedLimit);
/* WHEEL CIRCUMFERENCE */
wheel circumference .....: %d mm" = (getValue(CONSOLE, CONSOLE_GEOMETRY_CIRC_HI) << 8) + getValue(CONSOLE, CONSOLE_GEOMETRY_CIRC_LO);
" mountain cap ............: %0.2f%%" _NL,
(getValue(CONSOLE, CONSOLE_ASSIST_MOUNTAINCAP) * 1.5625));
printf( " odo .....................: %0.2f Km" _NL _NL,
((getValue(CONSOLE, CONSOLE_STATS_ODO_1) << 24) +
(getValue(CONSOLE, CONSOLE_STATS_ODO_2) << 16) +
(getValue(CONSOLE, CONSOLE_STATS_ODO_3) << 8) +
(getValue(CONSOLE, CONSOLE_STATS_ODO_4))) / (double)10
);
}
hwVersion = getValue(BATTERY, BATTERY_REF_HW);
if (hwVersion == 0)
printf("Battery not responding" _NL _NL);
else {
printf( "Battery information:" _NL
" hardware version ........: %02d" _NL
" software version ........: %02d" _NL,
hwVersion, getValue(BATTERY, BATTERY_REF_SW)
);
if (!gNoSerialNumbers)
printf( " part number .............: %05d" _NL
" item number .............: %05d" _NL,
((getValue(BATTERY, BATTERY_SN_PN_HI) << 8) + getValue(BATTERY, BATTERY_SN_PN_LO)),
((getValue(BATTERY, BATTERY_SN_ITEM_HI) << 8) + getValue(BATTERY, BATTERY_SN_ITEM_LO))
);
printf( " voltage .................: %0.2fV" _NL
" battery level ...........: %0.2f%%" _NL
" maximum voltage .........: %0.2f%%" _NL
" minimum voltage .........: %0.2f%%" _NL
" mean voltage ............: %0.2f%%" _NL
" resets ..................: %0d" _NL
" ggjrCalib ...............: %0d" _NL
" vctrlShorts .............: %0d" _NL
" lmd .....................: %0.2fAh" _NL
" cell capacity ...........: %0.2fAh" _NL _NL,
((getValue(BATTERY, BATTERY_STATUS_VBATT_HI) << 8) + getValue(BATTERY, BATTERY_STATUS_VBATT_LO)) * 0.001,
(getValue(BATTERY, BATTERY_STATUS_LEVEL) * 6.6667),
getVoltageValue(BATTERY, BATTERY_STATS_VBATTMAX),
getVoltageValue(BATTERY, BATTERY_STATS_VBATTMIN),
getVoltageValue(BATTERY, BATTERY_STATS_VBATTMEAN),
(getValue(BATTERY, BATTERY_STATS_RESET_HI) << 8) + getValue(BATTERY, BATTERY_STATS_RESET_LO),
getValue(BATTERY, BATTERY_STSTS_GGJSRCALIB),
getValue(BATTERY, BATTERY_STSTS_VCTRLSHORTS),
((getValue(BATTERY, BATTERY_STATS_LMD_HI) << 8) + getValue(BATTERY, BATTERY_STATS_LMD_LO)) * 0.002142,
((getValue(BATTERY, BATTERY_CONFIG_CELLCAPACITY_HI) << 8) + getValue(BATTERY, BATTERY_CONFIG_CELLCAPACITY_LO)) * 0.001
);
printf( " charge time worst .......: %0d" _NL
" charge time mean ........: %0d" _NL
" charge cycles ...........: %0d" _NL
" full charge cycles ......: %0d" _NL
" power cycles ............: %0d" _NL
" battery temp max ........: %0d" _NL
" battery temp min ........: %0d" _NL _NL,
(getValue(BATTERY, BATTERY_STATS_CHARGETIMEWORST_HI) << 8) + getValue(BATTERY, BATTERY_STATS_CHARGETIMEWORST_LO),
(getValue(BATTERY, BATTERY_STATS_CHARGETIMEMEAN_HI) << 8) + getValue(BATTERY, BATTERY_STATS_CHARGETIMEMEAN_LO),
(getValue(BATTERY, BATTERY_STATS_BATTCYCLES_HI) << 8) + getValue(BATTERY, BATTERY_STATS_BATTCYCLES_LO),
(getValue(BATTERY, BATTERY_STATS_BATTFULLCYCLES_HI) << 8) + getValue(BATTERY, BATTERY_STATS_BATTFULLCYCLES_LO),
(getValue(BATTERY, BATTERY_STATS_POWERCYCLES_HI) << 8) + getValue(BATTERY, BATTERY_STATS_POWERCYCLES_HI),
getValue(BATTERY, BATTERY_STATS_TBATTMAX),
getValue(BATTERY, BATTERY_STATS_TBATTMIN)
);
printChargeStats();
if (hwVersion >= 60)
printBatteryStats();
else
printf(" no battery details supported by battery hardware #%d" _NL _NL, hwVersion);
}
hwVersion = getValue(MOTOR, MOTOR_REF_HW);
if (hwVersion == 0)
printf("Motor not responding" _NL _NL);
else {
printf( "Motor information:" _NL
" hardware version ........: %02d" _NL
" software version ........: %02d" _NL
" temperature .............: %02d" _DEGREE_SIGN "C"_NL
" speed limit .............: %02d Km/h" _NL,
hwVersion, getValue(MOTOR, MOTOR_REF_SW),
getValue(MOTOR, MOTOR_REALTIME_TEMP),
getValue(MOTOR, MOTOR_ASSIST_MAXSPEED)
);
wheelCirc = (getValue(MOTOR, MOTOR_GEOMETRY_CIRC_HI) << 8) + getValue(MOTOR, MOTOR_GEOMETRY_CIRC_LO);
printf( " wheel circumference .....: %d mm" _NL _NL, wheelCirc);
if (!gNoSerialNumbers)
printf( " part number .............: %05d" _NL
" item number .............: %05d" _NL _NL,
((getValue(MOTOR, MOTOR_SN_PN_HI) << 8) + getValue(MOTOR, MOTOR_SN_PN_LO)),
((getValue(MOTOR, MOTOR_SN_ITEM_HI) << 8) + getValue(MOTOR, MOTOR_SN_ITEM_LO))
);
}
}