Modified for compatibility with Rev.E. hardware
Fork of AkmSensor by
ap1017ctrl.cpp
- Committer:
- tkstreet
- Date:
- 2017-04-17
- Revision:
- 26:4e436b0cbaf8
- Parent:
- 25:76c11ab5060e
- Child:
- 31:8635be9b2e35
File content as of revision 26:4e436b0cbaf8:
#include "ap1017ctrl.h" #include "debug.h" Ap1017Ctrl::Ap1017Ctrl() { ap1017 = NULL; event = false; ticker = NULL; sensorName = ""; } Ap1017Ctrl::~Ap1017Ctrl() { if(ap1017) delete ap1017; } AkmSensor::Status Ap1017Ctrl::init(const uint8_t id, const uint8_t subid) { primaryId = id; subId = subid; switch (subId) { // template for multiple drivers case SUB_ID_AP1017: ap1017 = new AP1017(); sensorName = "AP1017"; break; default: return AkmSensor::ERROR; } // TODO: Initialize ap1017 return AkmSensor::SUCCESS; } bool Ap1017Ctrl::isEvent() { return event; // No feedback: always false } AkmSensor::Status Ap1017Ctrl::startSensor() { ticker.attach(callback(this, &Ap1017Ctrl::eventCallback), interval); return AkmSensor::SUCCESS; } AkmSensor::Status Ap1017Ctrl::startSensor(const float sec) { interval = sec; ticker.attach(callback(this, &Ap1017Ctrl::eventCallback), interval); return AkmSensor::SUCCESS; } AkmSensor::Status Ap1017Ctrl::stopSensor() { return AkmSensor::SUCCESS; } AkmSensor::Status Ap1017Ctrl::readSensorData(Message* msg) { return AkmSensor::SUCCESS; } AkmSensor::Status Ap1017Ctrl::requestCommand(Message* in, Message* out) { return AkmSensor::SUCCESS; } char* Ap1017Ctrl::getSensorName() { return sensorName; }