i2ctransfer
expect binary or hex input in a specific format.
You're substituting strings that look like "0x30"
and "0x12"
but these are passed as plain strings, and likely malformed because:
{regPartA}
is just 4 chars like "0x30"
(but possibly "30"
?)
{regPartB}
might not be in the correct format either ("0x12"
)
If the format or spacing is off, i2ctransfer
ignores or fails to parse it.
Here’s how to do it properly:
string regPartA = "0x30"; // or dynamically parsed
string regPartB = "0x12";
string commandArgs = $"-f -y -v 16 w2@0x18 {regPartA} {regPartB} r2";
response = SystemHelper.CommandExec("i2ctransfer", commandArgs);