8 years ago.

I2C has no member "transfer" error.

Hi, I'm getting this error: Error: Class "mbed::I2C" has no member "transfer" in "main.cpp", Line: 27, Col: 10 and line 27 is

`i2c.transfer(address, (char *)txBuffer, 1,(char *)rxBuffer, 1, eSwitchCb, I2C_EVENT_TRANSFER_COMPLETE, false);

I know there is a transfer function, as you can see in the documents, so why is this error happening. What is the best way to debug it?

The help page for the error says to make sure there aren't any typos, I check multiple times, also I copied and pasted the line above.

I'm following the async transfer from https://developer.mbed.org/teams/SiliconLabs/wiki/Using-the-mbed-asynchronous-APIs page Cheers

2 Answers

7 years, 1 month ago.

Did you solve the problem? I am having the same issue and I don't know how to fix it.

7 years, 1 month ago.

The I2C async methods dont exist yet for all platforms. In fact, it seems they are currently only available on the SiliconLabs platforms. Use i2c.write or i2c.read instead.

thank you! I will try with that

posted by Nilli Martínez 01 Nov 2016