Mbed library to handle GPS data reception and parsing
Dependents: GPS_U-blox_NEO-6M_Code
Features
- All positionning parameters are contained into a global data structure.
- Automatic nema string parsing and data structure update.
- GSA,GGA,VTG and RMC
- Convert latitude and longitude to decimal value.
- Converts latittude,longitude and altitude to ECEF coordinates.
Planed developement
- Test library for RTOS use.
- Complete the nema parsing decoders (couple of parameters are not parsed yet and not present in the data structure).
- Add conversion tool to get ENU coordinates.
Diff: utils/CircularBuffer.h
- Revision:
- 0:0c1aa5906cef
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/utils/CircularBuffer.h Wed Aug 06 01:37:39 2014 +0000 @@ -0,0 +1,34 @@ +template< class T > +class CircularBuffer{ + public: + CircularBuffer(int FIFOsize) + { + m_FIFO = new T[FIFOsize]; + m_size = FIFOsize; + m_elementcount = 0; + m_outindex = 0; + }; + ~CircularBuffer() + { + delete[] m_FIFO; + }; + T Get() + { + m_elementcount--; + return m_FIFO[(m_outindex++)%m_size]; + }; + void Put(T n) + { + m_elementcount++; + m_FIFO[(m_elementcount+m_outindex)%m_size] = n; + }; + long GetElementCount() + { + return m_elementcount; + }; + private: + long m_size; + long m_elementcount; + long m_outindex; + T* m_FIFO; + }; \ No newline at end of file