Modified for compatibility with Rev.E. hardware
Fork of AkmSensor by
akmsensormanager.h
- Committer:
- masahikofukasawa
- Date:
- 2016-04-28
- Revision:
- 0:7a00359e701e
- Child:
- 2:11fe67783c4c
File content as of revision 0:7a00359e701e:
#ifndef AKMSENSORMANAGER_H #define AKMSENSORMANAGER_H #include "mbed.h" #include "SerialNano.h" #include "akmsensor.h" #include "Message.h" #define ANALOG_SENSOR_ID P0_4 #define ANALOG_SENSOR_ID_SUB P0_5 class AkmSensorManager { public: typedef enum { SUCCESS = 0, ERROR, } Status; AkmSensorManager(SerialNano* com, UARTService* service); Status init(); void setEventConnected(); void setEventDisconnected(); Status commandReceived(char* buf); bool isEvent(); Status processEvent(); void processCommand(); Status throwMessage(const Message *msg); private: AkmSensor* sensor; SerialNano* serial; UARTService* uartService; Message msg; uint8_t id; uint8_t subId; bool isEnabledBle; bool isEnabledUsb; bool eventCommandReceived; bool eventConnected; bool eventDisconnected; char userCommand[20]; AkmSensor* getAkmSensor(); uint8_t getId(PinName pin, uint8_t bits); void dataOut(char* str); }; #endif // AKMSENSORMANAGER_H