EEP fORK
Dependencies: BLE_API mbed nRF51822
Fork of MCS_LRF by
Diff: laser.h
- Revision:
- 8:ed66e7ef8243
- Parent:
- 7:8a23a257b66a
- Child:
- 10:d37cd13dd529
--- a/laser.h Wed Dec 09 03:28:42 2015 +0000 +++ b/laser.h Thu Dec 17 01:04:59 2015 +0000 @@ -22,11 +22,24 @@ void enableMeasurement(bool enable); float getDistance(); + void processRxData(char d); + void setDistaceCallback(void (*distanceCallback)(float distance, float elapsedTime)); + void triggerDistanceMeasurement(); + void setDebugCallback(void (*debugCallback)(char*)); private: + bool timerRunning; + Timer timer; + uint8_t idx; + static const uint8_t bufSize = 100; + char buf[bufSize]; Serial& serial; bool sendCommand(char cmd[]); + bool processResponse(); void split(char s[], char c, std::vector<char*>& v); + void processBuffer(); + void (*distanceCallback)(float distance, float elapsedTime); + void (*debugCallback)(char data[]); }; #endif // _LASER_ \ No newline at end of file