From 8c3efb592b16b672fc353368c04d88d3a32cf1a2 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Wed, 18 Jan 2012 18:02:10 +0000 Subject: updated previous demo to Arduino 1.0 --- arduino_libs/ByteBuffer/ByteBuffer.h | 74 ------------------------------------ 1 file changed, 74 deletions(-) delete mode 100755 arduino_libs/ByteBuffer/ByteBuffer.h (limited to 'arduino_libs/ByteBuffer/ByteBuffer.h') diff --git a/arduino_libs/ByteBuffer/ByteBuffer.h b/arduino_libs/ByteBuffer/ByteBuffer.h deleted file mode 100755 index f6b4e48..0000000 --- a/arduino_libs/ByteBuffer/ByteBuffer.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - ByteBuffer.h - A circular buffer implementation for Arduino - Created by Sigurdur Orn, July 19, 2010. - siggi@mit.edu - */ - -#ifndef ByteBuffer_h -#define ByteBuffer_h - -#include "WProgram.h" - -class ByteBuffer -{ -public: - ByteBuffer(); - - // This method initializes the datastore of the buffer to a certain sizem the buffer should NOT be used before this call is made - void init(unsigned int buf_size); - - // This method resets the buffer into an original state (with no data) - void clear(); - - // This releases resources for this buffer, after this has been called the buffer should NOT be used - void deAllocate(); - - // Returns how much space is left in the buffer for more data - int getSize(); - - // Returns the maximum capacity of the buffer - int getCapacity(); - - // This method returns the byte that is located at index in the buffer but doesn't modify the buffer like the get methods (doesn't remove the retured byte from the buffer) - byte peek(unsigned int index); - - // - // Put methods, either a regular put in back or put in front - // - int putInFront(byte in); - int put(byte in); - - int putIntInFront(int in); - int putInt(int in); - - int putLongInFront(long in); - int putLong(long in); - - int putFloatInFront(float in); - int putFloat(float in); - - // - // Get methods, either a regular get from front or from back - // - byte get(); - byte getFromBack(); - - int getInt(); - int getIntFromBack(); - - long getLong(); - long getLongFromBack(); - - float getFloat(); - float getFloatFromBack(); - -private: - byte* data; - - unsigned int capacity; - unsigned int position; - unsigned int length; -}; - -#endif - -- cgit v1.2.3