Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed PID ADXL345 Camera_LS_Y201 ITG3200 RangeFinder mbos xbee_lib Motor Servo
Module_Communication.h
00001 /* Copyright (c) 2012 - 2013 Yang Shi 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 du module communication. 00016 Le module communication gère la communication entre les modules présents sur le drône et le PC. 00017 * Input : 00018 * Output 00019 */ 00020 00021 #ifndef MODULE_COMMUNICATION_H 00022 #define MODULE_COMMUNICATION_H 00023 00024 #include "mbos.h" 00025 #include "xbee.h" 00026 #include "Buffer_Trame.h" 00027 #include "Service.h" 00028 00029 #define PINTX p13 00030 #define PINRX p14 00031 #define PINRES p15 00032 00033 00034 void moduleCommunicationReception(void); 00035 void moduleCommunicationEnvoi(void); 00036 char *getEnvoi(); 00037 00038 class C_ModuleCommunication 00039 { 00040 private : 00041 /* ATTRIBUTS */ 00042 xbee * m_xbee; 00043 C_FrameBuffer m_trameRxBuffer; 00044 C_FrameBuffer m_trameTxBuffer; 00045 char * m_charRxBuffer; 00046 char * m_charTxBuffer; 00047 00048 public : 00049 /* CONSTRUCTEUR(S) */ 00050 C_ModuleCommunication(); 00051 00052 /* DESTRUCTEUR */ 00053 ~C_ModuleCommunication(); 00054 00055 /* METHODES */ 00056 void moduleCommunicationTask(void); 00057 void traitementTrame(void); 00058 void envoiDeTrame(void); 00059 void receptionDeTrame(void); 00060 void creerTrameModuleTrajectoire(unsigned char idMessage); 00061 void creerTrameSpeciale(unsigned char idMessage); 00062 void consigneModuleTrajectoire(frame newFrame); 00063 void consigneModuleVideo(frame newFrame); 00064 00065 /* FONCTIONS */ 00066 00067 }; 00068 00069 #endif
Generated on Wed Jul 13 2022 02:33:40 by
1.7.2