Re: [RFC] i2c-tools: i2ctransfer: add new tool

From: Wolfram Sang
Date: Fri May 08 2015 - 10:38:40 EST



> Having slept over it, I came up with a 3rd proposal:
>
> # i2ctransfer 0 w0x11@0x50 0xc0 0xbd= r1@0x51
>
> That is, combining the slave address, direction and length into a
> single parameter. The advantage is that this is all more explicit and
> the risk of mixing up values is close to zero. Whether it is more or
> less readable than the previous proposals is probably a matter of
> taste. Also I suspect it would make the parsing and state machine more
> simple, but that's only a nice side effect.
>
> Wolfram (and others), please tell me what you think. I am not trying to
> force my views here, just suggesting alternatives for your
> consideration.

I liked your proposal, so thanks for this input. I agree that the risk
of mixing something up is high, I was okay with the printout of the
messages to be sent, but a better syntax is very welcome, too. I need to
think about the flags a little bit, though. Although this isn't
implemented yet, PEC and 10-bit flags might be added in the future?
Handling R/W as "just another" flag made this option extremly simple.
But we probably can work something out.

So much for the quick response, I'll have a closer look later.

Attachment: signature.asc
Description: Digital signature