static uint8_t PrintStatus(const CLS1_StdIOType *io) { unsigned char buf[24]; int i; CLS1_SendStatusStr((unsigned char*)"reflectance", (unsigned char*)"\r\n", io->stdOut); CLS1_SendStatusStr((unsigned char*)" state", REF_GetStateString(), io->stdOut); CLS1_SendStr((unsigned char*)"\r\n", io->stdOut); CLS1_SendStatusStr((unsigned char*)" raw val", (unsigned char*)"", io->stdOut); for (i=0;i<REF_NOF_SENSORS;i++) { if (i==0) { CLS1_SendStr((unsigned char*)"0x", io->stdOut); } else { CLS1_SendStr((unsigned char*)" 0x", io->stdOut); } buf[0] = '\0'; UTIL1_strcatNum16Hex(buf, sizeof(buf), SensorRaw[i]); CLS1_SendStr(buf, io->stdOut); } CLS1_SendStr((unsigned char*)"\r\n", io->stdOut); CLS1_SendStatusStr((unsigned char*)" min val", (unsigned char*)"", io->stdOut); for (i=0;i<REF_NOF_SENSORS;i++) { if (i==0) { CLS1_SendStr((unsigned char*)"0x", io->stdOut); } else { CLS1_SendStr((unsigned char*)" 0x", io->stdOut); } buf[0] = '\0'; UTIL1_strcatNum16Hex(buf, sizeof(buf), SensorCalibMinMax.minVal[i]); CLS1_SendStr(buf, io->stdOut); } CLS1_SendStr((unsigned char*)"\r\n", io->stdOut); CLS1_SendStatusStr((unsigned char*)" max val", (unsigned char*)"", io->stdOut); for (i=0;i<REF_NOF_SENSORS;i++) { if (i==0) { CLS1_SendStr((unsigned char*)"0x", io->stdOut); } else { CLS1_SendStr((unsigned char*)" 0x", io->stdOut); } buf[0] = '\0'; UTIL1_strcatNum16Hex(buf, sizeof(buf), SensorCalibMinMax.maxVal[i]); CLS1_SendStr(buf, io->stdOut); } CLS1_SendStr((unsigned char*)"\r\n", io->stdOut); CLS1_SendStatusStr((unsigned char*)" calib val", (unsigned char*)"", io->stdOut); for (i=0;i<REF_NOF_SENSORS;i++) { if (i==0) { CLS1_SendStr((unsigned char*)"0x", io->stdOut); } else { CLS1_SendStr((unsigned char*)" 0x", io->stdOut); } buf[0] = '\0'; UTIL1_strcatNum16Hex(buf, sizeof(buf), SensorCalibrated[i]); CLS1_SendStr(buf, io->stdOut); } CLS1_SendStr((unsigned char*)"\r\n", io->stdOut); return ERR_OK; }
static uint8_t PrintStatus(const CLS1_StdIOType *io) { unsigned char buf[24]; int i; CLS1_SendStatusStr((unsigned char*)"reflectance", (unsigned char*)"\r\n", io->stdOut); CLS1_SendStatusStr((unsigned char*)" state", REF_GetStateString(), io->stdOut); CLS1_SendStr((unsigned char*)"\r\n", io->stdOut); UTIL1_strcpy(buf, sizeof(buf), (unsigned char*)"0x"); UTIL1_strcatNum16Hex(buf, sizeof(buf), REF_MIN_NOISE_VAL); UTIL1_strcat(buf, sizeof(buf), (unsigned char*)"\r\n"); CLS1_SendStatusStr((unsigned char*)" min noise", buf, io->stdOut); CLS1_SendStatusStr((unsigned char*)" raw val", (unsigned char*)"", io->stdOut); for (i=0;i<REF_NOF_SENSORS;i++) { if (i==0) { CLS1_SendStr((unsigned char*)"0x", io->stdOut); } else { CLS1_SendStr((unsigned char*)" 0x", io->stdOut); } buf[0] = '\0'; UTIL1_strcatNum16Hex(buf, sizeof(buf), SensorRaw[i]); CLS1_SendStr(buf, io->stdOut); } CLS1_SendStr((unsigned char*)"\r\n", io->stdOut); CLS1_SendStatusStr((unsigned char*)" min val", (unsigned char*)"", io->stdOut); for (i=0;i<REF_NOF_SENSORS;i++) { if (i==0) { CLS1_SendStr((unsigned char*)"0x", io->stdOut); } else { CLS1_SendStr((unsigned char*)" 0x", io->stdOut); } buf[0] = '\0'; UTIL1_strcatNum16Hex(buf, sizeof(buf), SensorCalibMinMax.minVal[i]); CLS1_SendStr(buf, io->stdOut); } CLS1_SendStr((unsigned char*)"\r\n", io->stdOut); CLS1_SendStatusStr((unsigned char*)" max val", (unsigned char*)"", io->stdOut); for (i=0;i<REF_NOF_SENSORS;i++) { if (i==0) { CLS1_SendStr((unsigned char*)"0x", io->stdOut); } else { CLS1_SendStr((unsigned char*)" 0x", io->stdOut); } buf[0] = '\0'; UTIL1_strcatNum16Hex(buf, sizeof(buf), SensorCalibMinMax.maxVal[i]); CLS1_SendStr(buf, io->stdOut); } CLS1_SendStr((unsigned char*)"\r\n", io->stdOut); CLS1_SendStatusStr((unsigned char*)" calib val", (unsigned char*)"", io->stdOut); for (i=0;i<REF_NOF_SENSORS;i++) { if (i==0) { CLS1_SendStr((unsigned char*)"0x", io->stdOut); } else { CLS1_SendStr((unsigned char*)" 0x", io->stdOut); } buf[0] = '\0'; UTIL1_strcatNum16Hex(buf, sizeof(buf), SensorCalibrated[i]); CLS1_SendStr(buf, io->stdOut); } CLS1_SendStr((unsigned char*)"\r\n", io->stdOut); CLS1_SendStatusStr((unsigned char*)" line val", (unsigned char*)"", io->stdOut); buf[0] = '\0'; UTIL1_strcatNum16s(buf, sizeof(buf), refCenterLineVal); CLS1_SendStr(buf, io->stdOut); CLS1_SendStr((unsigned char*)"\r\n", io->stdOut); #if PL_CONFIG_HAS_LINE_FOLLOW CLS1_SendStatusStr((unsigned char*)" line kind", REF_LineKindStr(refLineKind), io->stdOut); CLS1_SendStr((unsigned char*)"\r\n", io->stdOut); #endif return ERR_OK; }