From: Gerhard Sittig Date: Sat, 31 Dec 2016 11:48:59 +0000 (+0100) Subject: asyc-ii: Unobfuscate a comment on packet parse constraints X-Git-Tag: libsigrok-0.5.0~152 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=c2debda60dd729e77ba89e1d3f370ebcc62811f1;p=libsigrok.git asyc-ii: Unobfuscate a comment on packet parse constraints The specific packet layout puts constraints on the parse logic (case sensitive comparison, order of comparison). Fix a comment that made no sense before, and better reflect that there are two constraints. --- diff --git a/src/dmm/asycii.c b/src/dmm/asycii.c index 8f5770f5..4cf02836 100644 --- a/src/dmm/asycii.c +++ b/src/dmm/asycii.c @@ -124,12 +124,16 @@ static int parse_value(const char *buf, struct asycii_info *info, * variable length. Flags immediately follow the unit. The remainder * of the text buffer is SPACE padded, and terminated with CR. * - * Notice the implementation detail of case *sensitive* comparison. - * This would break correct operation. It's essential that e.g. "Vac" - * gets split into the "V" unit and the "ac" flag, not into "VA" and - * the unknown "c" flag! In the absence of separators or fixed - * positions and with ambiguous text (when abbreviated), order of - * comparison matters, too. + * Notice the implementation detail of case @b sensitive comparison. + * Since the measurement unit and flags are directly adjacent and are + * not separated from each other, case insensitive comparison would + * yield wrong results. It's essential that e.g. "Vac" gets split into + * the "V" unit and the "ac" flag, not into "VA" and the unknown "c" + * flag! + * + * Notice, too, that order of comparison matters in the absence of + * separators or fixed positions and with ambiguous text (note that we do + * partial comparison). It's essential to e.g. correctly tell "VA" from "V". * * @param[in] buf The text buffer received from the DMM. * @param[out] info Broken down measurement details.