mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-30 10:31:02 +00:00
This change introduces the following modifications:
When used outside chroot on Goobuntu the serial interface fails to initialize
if parity enable bit is set (for a reason not clearly understood). On top of
that the tcsetattr() return value of zero is not a guarantee of success. To be
sure that the settings came through one is supposed to read back the driver
config and compare it with the desired config.
To add insult to injury, gPrecise driver rejects attempts to enable parity.
Parity setting is not essential in many cases, this is why we check the actual
config and if the only missing setting is parity we print a warning message
and continue.
In case an operation fails, the exit value should reflect that (so
that the autotest suite using the utility could report failure).
Often when the programming attempt is undertaken soon after reset,
this utility gets overwhelmed with the console output generated by the
EC on resets. Consume the output before proceeding.
Instead of printing a long set of dots (one per written/read block),
print a spinning wheel instead.
BRANCH=None
BUG=chrome-os-partner:15610
TEST=manual
. used the utility to program Snow EC both inside and outside
chroot, it succeeded.
Observed the failing attempt to set parity when running outside
chroot.
Observed spinning characters instead of stream of dots.
Change-Id: Id25595d35a2a3ca578639cebd508f599e618787c
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42310
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>