char queue for WiFi communication
objectQueue.h
- Committer:
- williampeers
- Date:
- 2017-08-23
- Revision:
- 2:8f54ba4d961f
- Parent:
- 1:f9e6627f1f59
File content as of revision 2:8f54ba4d961f:
#ifndef __STRQUEUE_INCLUDED__ #define __STRQUEUE_INCLUDED__ #include "mbed.h" #include "commands.h" class StrQueue { public: StrQueue(); StrQueue(int size); ~StrQueue(); int put(const char* message, int length = 0); int get(char* str, int size); int getChars(char* chars, int size); bool isfull(); bool isEmpty(); private: Mutex* lock; bool empty, full; int front, back; int size; char* chars; }; #endif