Hello,
I'm getting somewhere with QProcess.write, but.....
I use 'i2cdump -y -f 1 0x50 c' to check the eeprom. I can write data to the eeprom,
but nothing shows until a powerdown and boot, a soft reboot does not update.
uint num = 0xac; //172;
int8_t _bytes [1] {0x0A}; //line feed
process->start("eeprog-tear -f -16 -w 0xc2 -t 5 /dev/i2c-1 0x50");
process
->write
(QString::number(num
).
toLocal8Bit());
//writes 31 37 32process->write((char *)_bytes, 1); //line feed
fflush(stdout);
process->waitForBytesWritten();
process->waitForFinished();
p_stdOut = process->readAllStandardOutput();
qDebug() << "99 - " << p_stdOut;
p_stdErr = process->readAllStandardError();
qDebug() << "100 - " << p_stdErr;
process->close();//->terminate();
uint num = 0xac; //172;
int8_t _bytes [1] {0x0A}; //line feed
process->start("eeprog-tear -f -16 -w 0xc2 -t 5 /dev/i2c-1 0x50");
process->write(QString::number(num).toLocal8Bit()); //writes 31 37 32
process->write((char *)_bytes, 1); //line feed
fflush(stdout);
process->waitForBytesWritten();
process->waitForFinished();
p_stdOut = process->readAllStandardOutput();
qDebug() << "99 - " << p_stdOut;
p_stdErr = process->readAllStandardError();
qDebug() << "100 - " << p_stdErr;
process->close();//->terminate();
To copy to clipboard, switch view to plain text mode
i2cdump -y -f 1 0x50 c
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
...
b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
c0: ff ff 31 37 32 0a ff ff ff ff ff ff ff ff ff ff ..172?..........
d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
...
i2cdump -y -f 1 0x50 c
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
...
b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
c0: ff ff 31 37 32 0a ff ff ff ff ff ff ff ff ff ff ..172?..........
d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
...
To copy to clipboard, switch view to plain text mode
Output:-
99 - ""
100 - "eeprog 0.7.6-tear12, a 24Cxx EEPROM reader/writer
Copyright (c) 2003-2004 by Stefano Barbato - All rights reserved.
Copyright (c) 2011 by Kris Rusocki - All rights reserved.
Bus: /dev/i2c-1, Address: 0x50, Mode: 16bit
Operation: write at offset 194, Input file: <stdin>
Write cycle time: 5 milliseconds
Writing <stdin> starting at address 0xc2
Output:-
99 - ""
100 - "eeprog 0.7.6-tear12, a 24Cxx EEPROM reader/writer
Copyright (c) 2003-2004 by Stefano Barbato - All rights reserved.
Copyright (c) 2011 by Kris Rusocki - All rights reserved.
Bus: /dev/i2c-1, Address: 0x50, Mode: 16bit
Operation: write at offset 194, Input file: <stdin>
Write cycle time: 5 milliseconds
Writing <stdin> starting at address 0xc2
To copy to clipboard, switch view to plain text mode
The GUI I'm running from becomes un-responsive for about the same time as it would normally take to write the total eeprom.
I'm guessing that I'm not appplying the line feed properly.
Any suggestions would be greatly appreciated.
Regards
Bookmarks