A simple queue Class

Dependents:   MxSniffer

Revision:
0:0237fc3fb9ca
Child:
1:abfd5885f80d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Queue.h	Thu Apr 09 09:38:32 2015 +0000
@@ -0,0 +1,45 @@
+/*
+ *  QUEUE.h
+ *
+ *  Created on: 2013-5-9
+ *      Author: fu
+ */
+
+#ifndef QUEUE_H_
+#define QUEUE_H_
+
+#include "stdint.h"
+#define PACKAGE_MAX 128
+#define RFQUENEMAX 100
+
+
+struct RfData
+{
+	uint8_t rbuf[PACKAGE_MAX];
+	uint8_t length;
+	uint8_t payloadindex;
+	union
+	{
+		uint8_t rssi;
+		uint8_t destaddress;
+	} value;
+};
+
+class  QUEUE {
+private:
+
+	uint8_t front;
+	uint8_t rear;;
+public:
+	struct RfData RfData[RFQUENEMAX];
+	QUEUE();
+	void init_queue();
+	uint8_t inqueue( );
+	uint8_t dequeue();
+	void undodequeue();
+	uint8_t peerqueue();
+
+};
+
+#endif /* QUEUE_H_ */
+