Projet S5 Info / Mbed 2 deprecated Projet_S5

Dependencies:   mbed PowerControl

Fork of Projet_S5 by Jonathan Tousignant

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers trame.h Source File

trame.h

Go to the documentation of this file.
00001 /*!
00002  *  \file trame.h
00003  *  \brief Class that send command with the xbee
00004  *  \author Equipe P02
00005  *  \version 1
00006  *  \date 02/04/2014
00007  */
00008  
00009  #ifndef TRAME_H
00010 #define TRAME_H
00011 
00012 #include "mbed.h"
00013 
00014 using namespace std;
00015 
00016 /*! 
00017  *  \class Trame trame.h "trame.h"
00018  *  \brief Class that send data with the xbee
00019  */
00020 class Trame
00021 {
00022 public:
00023 
00024     /*!
00025      *  \brief Constructor
00026      *  \param _tx PinName for tx
00027      *  \param _rx PinName for rx
00028      */
00029     Trame(PinName _tx, PinName _rx);  
00030     
00031     /*!
00032      *  \brief Send a transmit request
00033      *  \param destination Destination of the request
00034      *  \param data Data to send
00035      *  \param lenght Lenght of the data
00036      */ 
00037     void sendTransmitRequest(const char* destination, const char* data, int length);
00038     
00039 private:
00040     /*!
00041      *  \brief Calculate checksum 8
00042      *  \param data Data for checksum
00043      *  \param lenght Lenght of the data
00044      */ 
00045     unsigned char crc8(const char* data, int length);
00046 
00047     PinName tx, rx;
00048 };
00049 
00050 #endif