-
-#ifdef UNUSED_CODE
-/**
- * \brief Command result formatting and printing.
- *
- * Prints out on device fd the values contained
- * in the array result, using the format specified
- * in fmt.
- *
- * \param ser Serial handle.
- * \param fmt Values format string.
- * \param result Array containing result to be printed.
- *
- * \return -1 in case of errors, otherwise 0.
- */
-static int printResult(struct Serial *ser, const char *fmt, parms result[])
-{
- long n;
- char repeat_cnt = 0;
-
- while (*fmt)
- {
- if (*fmt >= '0' && *fmt <= '9')
- {
- /* Collect repeat count digit (left to right order) */
- repeat_cnt = (repeat_cnt * 10) + (*fmt - '0');
- }
- else
- {
- /* Set default repeat cnt of 1 when not specified */
- if (repeat_cnt == 0)
- repeat_cnt = 1;
-
- /* Loop repeat_cnt times */
- do
- {
- switch (*fmt)
- {
- case 'd':
- ser_printf(ser, ARG_SEP_S "%ld", (*result).l);
- result++;
- break;
- case 'c':
- ser_print(ser, ARG_SEP_S);
- ser_print(ser, (*result).s);
- result++;
- break;
- case 's':
- ser_printf(ser, ARG_SEP_S "%s", (*result).s);
- result++;
- break;
- case 'n':
- n = (*result++).l;
- ser_printf(ser, ARG_SEP_S "%ld", n);
- while (n--) {
- ser_printf(ser, ARG_SEP_S "%ld", (*result).l);
- result++;
- }
- break;
- default:
- break;
- }
- }
- while (--repeat_cnt);
- }
-
- /* Skip to next format char */
- ++fmt;
-
- } /* while (*fmt) */
-
-
- ser_print(ser, "\r\n");
- return 0;
-}
-#endif /* UNUSED_CODE */
-