[En-Nut-Discussion] NutI2cMasterTransceive() versus NutI2cMasterTransact()
bon at elektron.ikp.physik.tu-darmstadt.de
Tue Feb 19 18:05:29 CET 2013
>>>>> "Harald" == Harald Kipp <harald.kipp at egnite.de> writes:
Harald> On 19.02.2013 17:00, Uwe Bonnes wrote:
>> NutI2cMasterTransact() should return the number of full messages
>> successfully transceived or return -1 in case of error. Other ideas?
Harald> One problem with this: Sometimes the master doesn't know the
Harald> size. In this case the slave will respond with NAK when the
Harald> master tries to read more.
Harald> In this case the caller needs to know how many bytes had been
Harald> actually delivered by the slave.
I think code like
rc= NutI2cMasterTransact(bus, NutI2C_MSG *msg, size)
if (rc != size)
if (rc >=0)
num_rec = msg[rc].msg_ridx;
would retrieve how many bytes had been actually delivered by the slave for
the failing message.
Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
More information about the En-Nut-Discussion