⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 communication.h.svn-base

📁 A simple protocol using CRC error check.
💻 SVN-BASE
字号:
/*
 * Communication.h
 *
 *  Created on: 19 mars 2009
 *      Author: Crest
 */

#ifndef COMMUNICATION_H_
#define COMMUNICATION_H_

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>

#define CARFIN "#"

//Define de Priorite
#define TRAME_PRIORITAIRE 64
#define TRAME_NORMALE 0

//Define de Type
#define TRAME_RAPPEL 1
#define TRAME_ODOMETRIE 2
#define TRAME_PRESENCE_DISTRIBUTEUR_PALET 3
#define TRAME_CONSIGNE_SERVOMOTEURS 4
#define TRAME_RETOUR_SERVOMOTEURS 5
#define TRAME_SERVOPOD 6
#define TRAME_POSITION 7

typedef struct trame{
	int priorite;
	int type;
	char *donnee;
	int crc;
}trame;

typedef struct file
{
    trame  donnee;
    struct file *suivant;
} File;


typedef struct resDiv{
	int quotient;
	int reste;
}resDiv;


void lectureEntete(unsigned char , trame *);
resDiv divisionEuclidienne(int , int );
void traitementTrame(File **, char *);
void inserer(File **, trame);
trame retirer(File **);
void effacerFile(File **);
char checkSumXor(unsigned char*,unsigned char);
trame decoderTrame(char *, trame );
void afficherTrame(trame);
char * codageTrame(int priorite, int type, char * donnee, char * message);

#endif /* COMMUNICATION_H_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -