Hi,
* Regarding CancelBlockReceive - When you use the CancelBlockReceive, you need to call the ReceiveBlock then to clear the data.
* Regarding the reception of variable length data - the steps should be the following:
1. call SlaveReceiveBlock() with the size larger than the part of the packet where you expect the size or command type to get information on the final size.
2. Use OnSlaveByteReceived() to process the bytes. If you detect get the size/type information adjust the expected size by calling SlaveUpdateReceiveBlockSize() method here.
3. After you'll get all the data, the event OnSlaveBlockReceived() is invoked.
4. Continue with the step 1.
* Regarding handling NACK from the master - When the slave receives NACK from the master, there is invoked OnError event, where you can chceck the type using GetError method and in this case it returns LDD_I2C_MASTER_NACK.
If you'd like to send NACK from the slave, then you can use the SendAcknowledge method with appropriate parameter.
best regards
Petr Hradsky
Processor Expert Support Team