mirror of
https://github.com/eclipse/upm.git
synced 2025-07-27 14:11:15 +03:00
Added iMagnetometer interface
Signed-off-by: Serban Waltter <serban.waltter@rinftech.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:

committed by
Mihai Tudor Panu

parent
aa966946d5
commit
f28a6d2561
@ -5,6 +5,6 @@ upm_mixed_module_init (NAME lsm303agr
|
||||
CPP_HDR lsm303agr.hpp
|
||||
CPP_SRC lsm303agr.cxx
|
||||
FTI_SRC lsm303agr_fti.c
|
||||
IFACE_HDR iAcceleration.hpp
|
||||
IFACE_HDR iAcceleration.hpp iMagnetometer.hpp
|
||||
CPP_WRAPS_C
|
||||
REQUIRES mraa utilities-c)
|
||||
|
@ -90,9 +90,10 @@ void LSM303AGR::getMagnetometer(float *x, float *y, float *z)
|
||||
|
||||
std::vector<float> LSM303AGR::getMagnetometer()
|
||||
{
|
||||
update();
|
||||
float v[3];
|
||||
|
||||
getMagnetometer(&v[0], &v[1], &v[2]);
|
||||
lsm303agr_get_magnetometer(m_lsm303agr, &v[0], &v[1], &v[2]);
|
||||
return std::vector<float>(v, v+3);
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "lsm303agr.h"
|
||||
|
||||
#include <interfaces/iAcceleration.hpp>
|
||||
#include <interfaces/iMagnetometer.hpp>
|
||||
|
||||
namespace upm {
|
||||
|
||||
@ -67,7 +68,7 @@ namespace upm {
|
||||
* @snippet lsm303agr.cxx Interesting
|
||||
*/
|
||||
|
||||
class LSM303AGR: virtual public iAcceleration {
|
||||
class LSM303AGR: virtual public iAcceleration, virtual public iMagnetometer {
|
||||
public:
|
||||
/**
|
||||
* LSM303AGR constructor
|
||||
|
Reference in New Issue
Block a user