i2clcd: use the mraa C++ API instead of the C API

Rewrite the i2c module to be based around the MRAA C++ API,
since this makes resource management easier inside of the UPM
C++ classes.

i2clcd.{h,cxx}: remove the close() function. This now automatically gets
called when the object goes out of scope, inside the destructor.

examples/i2clcd: fix C++/Python/Javascript examples that explicitly called the close function.
The I2c context now gets called by the destructor of the sensor class. This
happens when the object goes out of scope or when it gets deleted, if the
object was created using the new keyword, as is the case here.

Signed-off-by: Wouter van Verre <wouter.van.verre@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Wouter van Verre
2015-04-20 14:15:41 +01:00
committed by Mihai Tudor Panu
parent 53b58225a4
commit 31c4f470fe
17 changed files with 130 additions and 154 deletions

View File

@ -191,5 +191,4 @@ for (var i = 0; i < 12; i++)
myLcd.write('Hello World');
}
myLcd.close();