Index: tag/rc_1/ELMAADI/sp4a12/main.c
===================================================================
--- tag/rc_1/ELMAADI/sp4a12/main.c	(nonexistent)
+++ tag/rc_1/ELMAADI/sp4a12/main.c	(revision 435)
@@ -0,0 +1,379 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <strings.h>
+#include "trame.h"
+#include <math.h>
+
+
+/*Trames de tests à modifier si nécessaire.*/
+char * trames[]=  {"$GPGSV,3,2,10,15,03,077,,18,04,041,42,19,85,271,,20,08,214,*7C",
+                    "$GPGSV,3,3,10,22,39,053,50,28,15,320,*7E",
+                    "$GPRMC,141914.00,A,4545.6424,N,00306.6036,E,0.4,99.4,010206,,*0C",
+                    "$GPGLL,4545.6424,N,00306.6036,E,141914.00,A*0E",
+                    "$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D",
+                    "$GPGSA,A,3,,03,,22,14,,01,,18,,,,3.9,3.4,1.9*39",
+                    "$GPVTG,99.4,T,,M,0.4,N,0.7,K*57",
+                    "$GPZDA,141914.00,01,02,2006,00,00*69",
+                    0};
+/*Déclaration des structure*/
+typedef struct
+{
+    float latitude;
+    float longitude;
+}Position;
+
+typedef struct
+{
+    Position rpos;
+    float vitmax;
+}Zone;
+/*Définition des zone dangereuses*/
+Zone zones[]=
+{
+    {{44.788762, -3.012},50},
+    {{44.788762, -3.013},70},
+
+};
+
+/*Fonction qui renvoie 1 si la trame commence par la chaîne de caractère type et zéro dans les autres cas*/
+int trame_cmp(char *trame,char *type)
+{
+    int i;
+    int res=1;
+    for (i=0;i<5;i++)
+    {
+        if(trame[i+1]!=type[i]) /*Vérification si la trame commence par GPGGA */
+        {
+            res=0;
+        }
+    }
+    return res;
+}
+
+/*Fonction qui renvoie la valeur décimale associée à un caractère donné en paramètre.*/
+int decode_int(char c)
+{
+    int val;
+    val = c-48;/* Convertir caractère ASCII en entier*/
+    if (val>9)
+    {
+        val=-1;
+    }
+    return val;
+}
+
+/*Fonction qui renvoie la valeur décimale des n premiers caractères de la chaîne ch en utilisant decode_int()*/
+int decode_nombre(char *ch, int n)
+{
+    int i;
+    int S=0;
+    for(i=0;i<n;i++)
+    {
+        S = (S*10)+ decode_int(ch[i]);
+    }
+    return S;
+}
+
+/*Fonction qui permet de convertir la chaîne de caractère contenant la latitude en nombre flottant*/
+float latitude (char *ch)
+{
+    float degre, min1, min2, result;
+    degre=(float)decode_nombre(&ch[0],2); /* accéder au caractère qui nous intéresse*/
+    min1=(float)decode_nombre(&ch[0+2],2);
+    min2=(float)decode_nombre(&ch[0+5],4);
+    result=degre+(min1/60)+(min2/600000);/* Additionner tout après avoir tout converti en degré*/
+    return result;
+}
+
+/* Fonction qui permet de convertir  la chaîne de caractère contenant la longitude en nombre flottant */
+float longitude (char *ch)
+{
+    float degre, min1, min2, result;
+    degre=(float)decode_nombre(&ch[0],3);/*Idem*/
+    min1=(float)decode_nombre(&ch[0+3],2);
+    min2=(float)decode_nombre(&ch[0+6],4);
+    result=degre+(min1/60)+(min2/600000);/*Idem*/
+    return result;
+}
+
+/* Fonction générique qui décode indifféremment une latitude ou une longitude*/
+float latitude_longitude (char * ch)
+{
+    float result;
+    if(ch[4]==46)/*On determine la nature du caratère 5 pour choisir la bonne opération à faire*/
+    {
+        result=latitude(ch);
+    }
+    else
+    {
+        result=longitude(ch);
+    }
+    return result;
+}
+
+/*Fonction qui détermine la latitude et la lonngitude de la position*/
+float decode_trame(char *trame, Position *p)
+{
+   p->latitude=latitude(trame);
+   p->longitude=longitude(trame);
+}
+
+float calcule_distance(Position p_1, Position p_2) /*Calcul de la distance entre deux positions*/
+{
+    float dist;
+    dist=((2*3.14*6370)/360)*sqrt(pow((p_2.latitude-p_1.latitude),2)+pow((p_2.longitude-p_1.longitude),2));/* 6370 est le rayon de la terre*/
+    return dist;
+}
+
+float calcule_vitesse(Position p_1, Position p_2)/*calcul de la vitesse à l'aide de la distance entre deux positions */
+{
+    float vit;
+    vit=(calcule_distance(p_1,p_2)*3600);
+    return vit;
+}
+
+/*Fonction qui renvoie le numéro de la zone la plus proche du point p ainsi que sa distance.*/
+int distance_a_la_plus_proche_zone(Position p, Zone r[], int nb_zones, float *d)
+{
+    int i,j;
+    float D0;
+    D0=calcule_distance(p, r[0].rpos); /*Initialisation d'une distance de référence qui est la distnace initiale*/
+    if (nb_zones>0)
+    {
+        for(i=1;i>nb_zones;i++)
+        {
+            *d=calcule_distance(p,r[i].rpos);
+            if(*d<D0)
+            {
+                j=i;   /* changement de l'indice */
+                D0=*d; /* changement de la référence*/
+            }
+        }
+        return j;
+    }
+    else
+    {
+        return -1;
+    }
+
+
+}
+
+
+
+
+
+/*Fonction à modifier !!!!!*/
+void traitement(char * trame)
+{
+    /*static int cpt=0;
+    cpt++;
+    if (trame_cmp(trame,"GPGGA"))
+    {
+        printf ("> %s\n",trame); /*Afficher que les trames GPGGA*/
+    }*/
+    Position P,P0;
+    float vit, dist;
+    int zone_nb, trameOK, alarme=0, Dmax=1;/*Dmax:distance maximale pour déclencher l'alarme*/
+    trameOK=1;
+    if (trame_cmp(trame,"GPGGA")==1)
+    {
+        printf("> %s\n",trame);
+        if(trameOK==1)
+        {
+            trameOK=0;
+            decode_trame(trame,&P);
+            if(&P)
+            {
+                vit=calcule_vitesse(P,P0);
+                zone_nb=distance_a_la_plus_proche_zone(P,zones,zone_nb,&dist);
+                if((dist<Dmax)&(vit>zones[zone_nb].vitmax))
+                {
+                    alarme=1;
+
+                }
+                if(alarme==1)
+                {
+                    printf("alarme ON\n");
+                }
+                else
+                {
+                    printf("alarme OFF\n");
+                }
+                P0=P;
+            }
+            printf("vitesse : %.2f    distance : %.2f\n\n",vit,dist);
+        }
+    }
+
+}
+
+/*Ajouter vos tests unitaires dans cette fonction.*/
+void tests_unitaires(void){
+
+/*Test de vérification du bon fonctionnement*/
+if (5!=5)
+{
+    printf ("Erreur Test unitaire basique.\n");
+    exit(-1);
+}
+
+/*Tests de la fonction tram_cmp*/
+if (trame_cmp("$GPGGA suite chaine","GPGGA")!=1)
+{
+    printf ("Erreur Test unitaire trame_cmp.\n");
+    exit(-1);
+}
+if (trame_cmp("$GPRMC suite chaine","GPGGA")!=0)
+{
+    printf ("Erreur Test unitaire trame_cmp.\n");
+    exit(-1);
+}
+if (trame_cmp("$GPRMC... ", "GPRMC" )!=1)
+{
+    printf ("Erreur Test unitaire trame_cmp.\n");
+    exit(-1);
+}
+if (trame_cmp("$APRMC...", "GPGGA")!=0)
+{
+    printf ("Erreur Test unitaire trame_cmp.\n");
+    exit(-1);
+}
+
+/*Test de la fonction decode_int*/
+if (decode_int('2')!=2)
+{
+    printf ("Erreur Test unitaire decode_int.\n");
+    exit(-1);
+}
+
+/*Test de la fonction decode_nombre*/
+if (decode_nombre("1234",2)!=12)
+{
+    printf ("Erreur Test unitaire decode_nombre.\n");
+    exit(-1);
+}
+
+/*Test de la fonction latitude*/
+if (latitude("3723.2475")-37.387458>0.0001)
+{
+    printf ("Erreur Test unitaire latitude.\n");
+    exit(-1);
+}
+
+/*Test de la fonction longitude */
+if (longitude("00306.6043")-3.110071667>0.01)
+{
+    printf ("Erreur Test unitaire longitude.\n");
+    exit(-1);
+}
+
+/*Tests de la fonction latitude_longitude*/
+if (latitude_longitude("00306.6043")-3.110071667>0.01)
+{
+    printf ("Erreur Test unitaire latitude_longitude.\n");
+    exit(-1);
+}
+
+if (latitude_longitude("3723.2475")-37.387458>0.0001)
+{
+    printf ("Erreur Test unitaire latitude_longitude.\n");
+    exit(-1);
+}
+
+if (latitude_longitude("3452.1463")-34.869105>0.0001)
+{
+    printf ("Erreur Test unitaire latitude_longitude.\n");
+    exit(-1);
+}
+
+if (latitude_longitude("03815.1974")-38.25329>0.01)
+{
+    printf ("Erreur Test unitaire latitude_longitude.\n");
+    exit(-1);
+}
+/*Position p;*/ /*Tests de la fonction decode_trame*/
+/*if (decode_trame("$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D",&p)!=1)
+{
+    printf ("Erreur Test unitaire decode_trame.\n");
+    exit(-1);
+}
+if (decode_trame("$GPGGA,141918.00,4545.0968,N,00306.6034,E,1,05,3.4,498.8,M,,M,,*7A",&p)!=1)
+{
+    printf ("Erreur Test unitaire decode_trame.\n");
+    exit(-1);
+}
+if (decode_trame("$GPGGA,141925.00,4545.2410,N,00306.6046,E,1,05,3.4,501.4,M,,M,,*7C",&p)!=1)
+{
+    printf ("Erreur Test unitaire decode_trame.\n");
+    exit(-1);
+}
+if (decode_trame("$GPGGA,141922.00,4545.1810,N,00306.6046,E,1,05,3.4,500.6,M,,M,,*77",&p)!=1)
+{
+    printf ("Erreur Test unitaire decode_trame.\n");
+    exit(-1);
+}*/
+/*Test du calcul de la distance et de la vitesse pour un intervalle de 1s*/
+/*Position p_1, p_2, p_3;
+p_2.latitude=latitude("$GPGGA,141915.00,4545.0242,N,00306.6039,E,1,05,3.4,499.5,M,,M,,*75");
+p_2.longitude=longitude("$GPGGA,141915.00,4545.0242,N,00306.6039,E,1,05,3.4,499.5,M,,M,,*75");
+p_1.latitude=latitude("$GPGGA,141917.00,4545.0726,N,00306.6039,E,1,05,3.4,499.6,M,,M,,*73");
+p_1.longitude=longitude("$GPGGA,141917.00,4545.0726,N,00306.6039,E,1,05,3.4,499.6,M,,M,,*73");
+
+    printf("distance: %f\n",calcule_distance(p_1,p_2));
+    printf("vitesse: %f\n",calcule_vitesse(p_1,p_2));*/
+
+
+/*Test  pour calculer la distance entre deux villes*/
+    /*Paris*/
+/*p_1.latitude = 48.8588897;
+p_1.longitude = 2.320041;*/
+    /*Lyon*/
+/*p_2.latitude = 45.7578137;
+p_2.longitude = 4.8320114;*/
+    /*Toulouse*/
+/*p_3.latitude = 43.7520597;
+p_3.longitude = 1.2877314;
+    printf("distance Paris-Lyon : %f\n",calcule_distance(p_1,p_2));
+    printf("distance Lyon-Toulouse : %f\n",calcule_distance(p_2,p_3));*/
+int nb_zone; /*Test de la fonction distance_a_la_plus_proche_zone*/
+float *d;
+Position p,p1,p2;
+nb_zone=distance_a_la_plus_proche_zone(p,zones,2,&d);
+p1.latitude=44.7887762;
+p1.longitude=-3.012;
+p2.latitude=44.7891220;
+p2.longitude=-3.013;
+decode_trame("$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D", &p);
+    printf("D1 est : %f\n",calcule_distance(p, p1));
+    printf("D2 est : %f\n",calcule_distance(p, p2));
+    if(nb_zone!=0)
+    {
+        printf("Erreur dans la zone la plus proche");
+        exit(-1);
+    }
+
+}
+
+/* Ne pas modifier cette fonction*/
+int main(int argc,char ** argv)
+{
+
+    tests_unitaires();
+
+    /* Affichage des trames definies dans la table trames.*/
+    printf ("Trames de tests tableau trames:\n");
+    int i=0;
+    while (trames[i])
+        traitement(trames[i++]);
+
+    if (!trame_init())
+        exit(-1);
+    /* Affichage des trames du fichier gps.log*/
+    char *trame;
+    printf ("Trames de tests du fichier gps.log\n");
+    while  ((trame = trame_suivante()))
+        traitement(trame);
+
+    return 0;
+}
Index: tag/rc_1/ELMAADI/sp4a12/gps.log
===================================================================
--- tag/rc_1/ELMAADI/sp4a12/gps.log	(nonexistent)
+++ tag/rc_1/ELMAADI/sp4a12/gps.log	(revision 435)
@@ -0,0 +1,111 @@
+$GPGSV,3,2,10,15,03,077,,18,04,041,42,19,85,271,,20,08,214,*7C
+$GPGSV,3,3,10,22,39,053,50,28,15,320,*7E
+$GPRMC,141914.00,A,4545.6424,N,00306.6036,E,0.4,99.4,010206,,*0C
+$GPGLL,4545.6424,N,00306.6036,E,141914.00,A*0E
+$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*79
+$GPGSA,A,3,,03,,22,14,,01,,18,,,,3.9,3.4,1.9*39
+$GPVTG,99.4,T,,M,0.4,N,0.7,K*57
+$GPZDA,141914.00,01,02,2006,00,00*69
+$GPGSV,3,1,10,01,13,142,46,03,48,144,47,11,41,277,,14,27,104,42*75
+$GPGSV,3,2,10,15,03,077,,18,04,041,41,19,85,271,,20,08,214,*7F
+$GPGSV,3,3,10,22,39,053,48,28,15,320,*77
+$GPRMC,141915.00,A,4545.6423,N,00306.6039,E,0.6,110.2,010206,,*31
+$GPGLL,4545.6423,N,00306.6039,E,141915.00,A*07
+$GPGGA,141915.00,4545.0242,N,00306.6039,E,1,05,3.4,499.5,M,,M,,*75
+$GPGSA,A,3,,03,,22,14,,01,,18,,,,3.9,3.4,1.9*39
+$GPVTG,110.2,T,,M,0.6,N,1.2,K*67
+$GPZDA,141915.00,01,02,2006,00,00*68
+$GPGSV,3,1,10,01,13,142,45,03,48,144,47,11,41,277,,14,27,104,41*75
+$GPGSV,3,2,10,15,03,077,,18,04,041,42,19,85,271,,20,08,214,*7C
+$GPGSV,3,3,10,22,39,053,49,28,15,320,*76
+$GPRMC,141916.00,A,4545.6422,N,00306.6037,E,0.1,211.1,010206,,*3B
+$GPGLL,4545.6422,N,00306.6037,E,141916.00,A*0B
+$GPGGA,141916.00,4545.0484,N,00306.6037,E,1,05,3.4,500.0,M,,M,,*70
+$GPGSA,A,3,,03,,22,14,,01,,18,,,,3.9,3.4,1.9*39
+$GPVTG,211.1,T,,M,0.1,N,0.2,K*60
+$GPZDA,141916.00,01,02,2006,00,00*6B
+$GPGSV,3,1,10,01,13,142,45,03,48,144,48,11,41,277,,14,27,104,43*78
+$GPGSV,3,2,10,15,03,077,,18,04,041,44,19,85,271,,20,08,214,*7A
+$GPGSV,3,3,10,22,39,053,48,28,15,320,*77
+$GPRMC,141917.00,A,4545.6422,N,00306.6039,E,0.3,122.3,010206,,*37
+$GPGLL,4545.6422,N,00306.6039,E,141917.00,A*04
+$GPGGA,141917.00,4545.0726,N,00306.6039,E,1,05,3.4,499.6,M,,M,,*73
+$GPGSA,A,3,,03,,22,14,,01,,18,,,,3.9,3.4,1.9*39
+$GPVTG,122.3,T,,M,0.3,N,0.5,K*64
+$GPZDA,141917.00,01,02,2006,00,00*6A
+$GPGSV,3,1,10,01,13,142,45,03,48,144,46,11,41,277,,14,27,104,41*74
+$GPGSV,3,2,10,15,03,077,,18,04,041,42,19,85,271,,20,08,214,*7C
+$GPGSV,3,3,10,22,39,053,48,28,15,320,*77
+$GPRMC,141918.00,A,4545.6421,N,00306.6034,E,0.5,252.2,010206,,*35
+$GPGLL,4545.6421,N,00306.6034,E,141918.00,A*05
+$GPGGA,141918.00,4545.0968,N,00306.6034,E,1,05,3.4,498.8,M,,M,,*7A
+$GPGSA,A,3,,03,,22,14,,01,,18,,,,3.9,3.4,1.9*39
+$GPVTG,252.2,T,,M,0.5,N,1.0,K*63
+$GPZDA,141918.00,01,02,2006,00,00*65
+$GPGSV,3,1,10,01,13,142,45,03,48,144,48,11,41,277,,14,27,104,42*79
+$GPGSV,3,2,10,15,03,077,,18,04,041,42,19,85,271,,20,08,214,*7C
+$GPGSV,3,3,10,22,38,053,49,28,15,320,*77
+$GPRMC,141919.00,A,4545.6420,N,00306.6040,E,0.6,95.2,010206,,*0C
+$GPGLL,4545.6420,N,00306.6040,E,141919.00,A*06
+$GPGGA,141919.00,4545.1210,N,00306.6040,E,1,05,3.4,500.2,M,,M,,*77
+$GPGSA,A,3,,03,,22,14,,01,,18,,,,3.9,3.4,1.9*39
+$GPVTG,95.2,T,,M,0.6,N,1.2,K*5B
+$GPZDA,141919.00,01,02,2006,00,00*64
+$GPGSV,3,1,10,01,13,142,46,03,48,144,49,11,41,277,,14,27,104,42*7B
+$GPGSV,3,2,10,15,03,077,,18,04,041,43,19,85,271,,20,08,214,*7D
+$GPGSV,3,3,10,22,38,053,49,28,15,320,*77
+$GPRMC,141920.00,A,4545.6419,N,00306.6039,E,0.2,133.1,010206,,*38
+$GPGLL,4545.6419,N,00306.6039,E,141920.00,A*08
+$GPGGA,141920.00,4545.1410,N,00306.6039,E,1,05,3.4,500.0,M,,M,,*77
+$GPGSA,A,3,,03,,22,14,,01,,18,,,,3.9,3.4,1.9*39
+$GPVTG,133.1,T,,M,0.2,N,0.4,K*66
+$GPZDA,141920.00,01,02,2006,00,00*6E
+$GPGSV,3,1,10,01,13,142,45,03,48,144,46,11,41,277,,14,27,104,43*76
+$GPGSV,3,2,10,15,03,077,,18,04,041,41,19,85,271,,20,08,214,*7F
+$GPGSV,3,3,10,22,38,053,50,28,15,320,*7F
+$GPRMC,141921.00,A,4545.6419,N,00306.6043,E,0.6,103.1,010206,,*33
+$GPGLL,4545.6419,N,00306.6043,E,141921.00,A*04
+$GPGGA,141921.00,4545.1610,N,00306.6043,E,1,05,3.4,499.8,M,,M,,*70
+$GPGSA,A,3,,03,,22,14,,01,,18,,,,3.9,3.4,1.9*39
+$GPVTG,103.1,T,,M,0.6,N,1.1,K*65
+$GPZDA,141921.00,01,02,2006,00,00*6F
+$GPGSV,3,1,10,01,13,142,46,03,48,144,48,11,41,277,,14,27,104,42*7A
+$GPGSV,3,2,10,15,03,077,,18,04,041,42,19,85,271,,20,08,214,*7C
+$GPGSV,3,3,10,22,38,053,48,28,15,320,*76
+$GPRMC,141922.00,A,4545.6418,N,00306.6046,E,0.7,96.9,010206,,*00
+$GPGLL,4545.6418,N,00306.6046,E,141922.00,A*03
+$GPGGA,141922.00,4545.1810,N,00306.6046,E,1,05,3.4,500.6,M,,M,,*77
+$GPGSA,A,3,,03,,22,14,,01,,18,,,,3.9,3.4,1.9*39
+$GPVTG,96.9,T,,M,0.7,N,1.3,K*53
+$GPZDA,141922.00,01,02,2006,00,00*6C
+$GPGSV,3,1,10,01,13,142,47,03,48,144,46,11,41,277,,14,27,104,43*74
+$GPGSV,3,2,10,15,03,077,,18,04,041,43,19,85,271,,20,08,214,*7D
+$GPGSV,3,3,10,22,38,053,48,28,15,320,*76
+$GPRMC,141923.00,A,4545.6417,N,00306.6046,E,0.3,113.6,010206,,*39
+$GPGLL,4545.6417,N,00306.6046,E,141923.00,A*0D
+$GPGGA,141923.00,4545.2010,N,00306.6046,E,1,05,3.4,500.6,M,,M,,*7D
+$GPGSA,A,3,,03,,22,14,,01,,18,,,,3.9,3.4,1.9*39
+$GPVTG,113.6,T,,M,0.3,N,0.7,K*61
+$GPZDA,141923.00,01,02,2006,00,00*6D
+$GPGSV,3,1,10,01,13,142,45,03,48,144,47,11,41,277,,14,27,104,41*75
+$GPGSV,3,2,10,15,03,077,,18,04,041,43,19,85,271,,20,08,214,*7D
+$GPGSV,3,3,10,22,38,053,49,28,15,320,*77
+$GPRMC,141924.00,A,4545.6416,N,00306.6044,E,0.2,197.7,010206,,*31
+$GPGLL,4545.6416,N,00306.6044,E,141924.00,A*09
+$GPGGA,141924.00,4545.2210,N,00306.6044,E,1,05,3.4,500.5,M,,M,,*79
+$GPGSA,A,3,,03,,22,14,,01,,18,,,,3.9,3.4,1.9*39
+$GPVTG,197.7,T,,M,0.2,N,0.4,K*6E
+$GPZDA,141924.00,01,02,2006,00,00*6A
+$GPGSV,3,1,10,01,13,142,45,03,48,144,47,11,41,277,,14,27,104,40*74
+$GPGSV,3,2,10,15,03,077,,18,04,041,43,19,85,271,,20,08,214,*7D
+$GPGSV,3,3,10,22,38,053,49,28,15,320,*77
+$GPRMC,141925.00,A,4545.6415,N,00306.6046,E,0.2,130.8,010206,,*33
+$GPGLL,4545.6415,N,00306.6046,E,141925.00,A*09
+$GPGGA,141925.00,4545.2410,N,00306.6046,E,1,05,3.4,501.4,M,,M,,*7C
+$GPGSA,A,3,,03,,22,14,,01,,18,,,,3.9,3.4,1.9*39
+$GPVTG,130.8,T,,M,0.2,N,0.5,K*6D
+$GPZDA,141925.00,01,02,2006,00,00*6B
+$GPGSV,3,1,10,01,13,142,45,03,48,144,47,11,41,277,,14,27,104,40*74
+$GPGSV,3,2,10,15,03,077,,18,04,041,41,19,85,271,,20,08,214,*7F
+$GPGSV,3,3,10,22,38,053,47,28,15,320,*79
+$GPRMC,141926.°E,0.2,260.8,010206,,*34
Index: tag/rc_1/ELMAADI/sp4a12/trame.c
===================================================================
--- tag/rc_1/ELMAADI/sp4a12/trame.c	(nonexistent)
+++ tag/rc_1/ELMAADI/sp4a12/trame.c	(revision 435)
@@ -0,0 +1,28 @@
+/* Fichier trames.c - Gestion et decodage des trames */
+/* Ce fichier sera fourni */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "trame.h"
+
+#define FICHIER_TRAMES "gps.log"  /* Par exemple */
+
+#define MAX_FRAME_LENGTH 80
+
+static char trame_buf[MAX_FRAME_LENGTH];
+static FILE *trame_fic;
+
+int trame_init(void)
+{
+    trame_fic = fopen(FICHIER_TRAMES, "r");
+    if (trame_fic)
+        return 1;
+
+    fprintf(stderr, "Impossible d'ouvrir le fichier %s\n", FICHIER_TRAMES);
+    return 0;
+}
+
+char *trame_suivante(void)
+{
+  return fgets(trame_buf, MAX_FRAME_LENGTH-1, trame_fic);
+}
Index: tag/rc_1/ELMAADI/sp4a12/sp4a.cbp
===================================================================
--- tag/rc_1/ELMAADI/sp4a12/sp4a.cbp	(nonexistent)
+++ tag/rc_1/ELMAADI/sp4a12/sp4a.cbp	(revision 435)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="sp4a" />
+		<Option pch_mode="2" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="Debug">
+				<Option output="sp4a" prefix_auto="1" extension_auto="1" />
+				<Option object_output=".\debug" />
+				<Option type="1" />
+				<Option compiler="gcc" />
+				<Compiler>
+					<Add option="-g" />
+				</Compiler>
+			</Target>
+		</Build>
+		<Compiler>
+			<Add option="-Wall" />
+		</Compiler>
+		<Unit filename="gps.log" />
+		<Unit filename="main.c">
+			<Option compilerVar="CC" />
+		</Unit>
+		<Unit filename="trame.c">
+			<Option compilerVar="CC" />
+		</Unit>
+		<Unit filename="trame.h" />
+		<Extensions>
+			<code_completion />
+			<envvars />
+			<debugger />
+			<lib_finder disable_auto="1" />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
Index: tag/rc_1/ELMAADI/sp4a12/trame.h
===================================================================
--- tag/rc_1/ELMAADI/sp4a12/trame.h	(nonexistent)
+++ tag/rc_1/ELMAADI/sp4a12/trame.h	(revision 435)
@@ -0,0 +1,3 @@
+
+int trame_init(void);
+char * trame_suivante(void);
