ajout module_mouvement

Dependencies:   mbed xbee_lib ADXL345_I2C IMUfilter ITG3200 Motor RangeFinder Servo mbos PID

Fork of Labo_TRSE_Drone by HERBERT Nicolas

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Buffer_Trame.h Source File

Buffer_Trame.h

00001  /* Copyright (c) 2012 - 2013 AUTEUR
00002  *
00003  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED 
00004  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
00005  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
00006  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
00007  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 
00008  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
00009  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
00010  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 
00011  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00012  */
00013  
00014  /*
00015  * Description : Cette classe contient les fonctionnalités d'un buffer de trame.
00016  * Input
00017  * Output
00018  */
00019  
00020  
00021  #ifndef BUFFER_TRAME_H
00022  #define BUFFER_TRAME_H
00023  
00024  #include "mbos.h"
00025  
00026  #define default_size 50
00027  
00028  typedef struct {
00029     char systemIdentifier;
00030     char moduleIdentifier;
00031     char messageIdentifier;
00032     char data [12];
00033  }frame;
00034  
00035  class C_FrameBuffer {
00036  
00037  private :
00038     /* ATTRIBUTS */
00039     frame * m_frameBuffer;
00040     unsigned int m_currentReadIndex;
00041     unsigned int m_currentWriteIndex;
00042     unsigned int m_numberMessage;
00043     unsigned int m_maxSize;
00044     
00045  public :
00046     /* CONSTRUCTEUR(S) */
00047     C_FrameBuffer();
00048     C_FrameBuffer(unsigned int size);
00049     
00050     /* DESTRUCTEUR */
00051     ~C_FrameBuffer();
00052     
00053     /* Propriétés */
00054     void frameBuffer(frame newFrame);
00055     frame frameBuffer(void);
00056     unsigned int maxSize(void);
00057     unsigned int currentReadIndex(void);
00058     unsigned int currentWriteIndex(void);
00059     unsigned int numberMessage(void);
00060  };
00061  
00062  #endif