##// END OF EJS Templates
imanay -
r45:46
parent child
Show More
@@ -0,0 +1,324
1 /*
No newline at end of file
2 * Servidor.c
No newline at end of file
3 *
No newline at end of file
4 * Created on: Nov 3, 2009
No newline at end of file
5 * Author: Jose Francisco Quenta
No newline at end of file
6 *
No newline at end of file
7 * Se implementa:
No newline at end of file
8 * -Carga en memoria los apuntes contenidos en un archivo de experimentos: apunte0 -> GPIO
No newline at end of file
9 * -Cambio de apunte.
No newline at end of file
10 * -Lectura del estado actual del apunte y grabado del mismo en un archivo
No newline at end of file
11 */
No newline at end of file
12
No newline at end of file
13 #include <stdio.h>
No newline at end of file
14 #include <stdlib.h>
No newline at end of file
15 #include <string.h>
No newline at end of file
16 #include <unistd.h>
No newline at end of file
17 #include <errno.h>
No newline at end of file
18
No newline at end of file
19 #include <sys/types.h>
No newline at end of file
20 #include <sys/socket.h>
No newline at end of file
21 #include <netinet/in.h>
No newline at end of file
22 #include <arpa/inet.h>
No newline at end of file
23 #include <netdb.h>
No newline at end of file
24
No newline at end of file
25 #include "./Librerias/AT91gpio_Funciones.h"
No newline at end of file
26 #include "./Librerias/Mensajes.h"
No newline at end of file
27
No newline at end of file
28 #define PUERTO_SERVIDOR 5500
No newline at end of file
29 #define TAM_BUFFER 100
No newline at end of file
30
No newline at end of file
31 #define maskc_out PC30+PC28+PC26+PC24+PC22+PC20 //MSB-UP-LSB MSB-DOWN-LSB //APUNTE
No newline at end of file
32
No newline at end of file
33 #define maskb_in PB16+PB18+PB20+PB30+PB24+PB22 //MSB-UP-LSB MSB-DOWN-LSB //VERIFICACION
No newline at end of file
34
No newline at end of file
35 #define bit_up_2 0x00010000 //Mascara de cada bit a revisar: bit_up_2 es MSB
No newline at end of file
36 #define bit_up_1 0x00040000
No newline at end of file
37 #define bit_up_0 0x00100000
No newline at end of file
38 #define bit_dow_2 0x40000000
No newline at end of file
39 #define bit_dow_1 0x01000000
No newline at end of file
40 #define bit_dow_0 0x00400000
No newline at end of file
41
No newline at end of file
42 #define MyID 11
No newline at end of file
43
No newline at end of file
44 char *buff_experimento= NULL;
No newline at end of file
45
No newline at end of file
46 AT91S_PIO *pioc;
No newline at end of file
47 AT91S_PIO *piob;
No newline at end of file
48
No newline at end of file
49 /*
No newline at end of file
50 * Zona de declaracion de cabeceras.
No newline at end of file
51 */
No newline at end of file
52 void inicializa_gpio();
No newline at end of file
53 int procesa_peticion(char *buff_peticion);
No newline at end of file
54 int cambia_apuntamiento(char *puntero_char);
No newline at end of file
55 int carga_experimento(char *nombre_archivo);
No newline at end of file
56 int chequeo_sistema(char *numero_muestras);
No newline at end of file
57
No newline at end of file
58 /*
No newline at end of file
59 *
No newline at end of file
60 */
No newline at end of file
61 int main(){
No newline at end of file
62
No newline at end of file
63 int conexion_servidorFd;
No newline at end of file
64 struct sockaddr_in inf_servidor;
No newline at end of file
65 struct sockaddr_storage inf_cliente;
No newline at end of file
66 int resultado;
No newline at end of file
67 int numbytes_recibidos;
No newline at end of file
68 int rpta;
No newline at end of file
69
No newline at end of file
70 char *buff_peticion = (char *) malloc(TAM_BUFFER);
No newline at end of file
71
No newline at end of file
72 size_t addr_len;
No newline at end of file
73
No newline at end of file
74 memset(&inf_servidor, 0, sizeof(inf_servidor));
No newline at end of file
75 inf_servidor.sin_family= AF_INET;
No newline at end of file
76 inf_servidor.sin_port= htons(PUERTO_SERVIDOR);
No newline at end of file
77 inf_servidor.sin_addr.s_addr= INADDR_ANY;
No newline at end of file
78
No newline at end of file
79 /* Se establece el socket */
No newline at end of file
80 conexion_servidorFd = socket(AF_INET,SOCK_DGRAM,0);
No newline at end of file
81 if (conexion_servidorFd == -1){
No newline at end of file
82 ERROR_FATAL("No se establecio correctamente el socket: socket()");
No newline at end of file
83 }
No newline at end of file
84
No newline at end of file
85 /* Se asocia el socket a un puerto y una IP */
No newline at end of file
86 resultado = bind(conexion_servidorFd,(struct sockaddr *)&inf_servidor,sizeof(inf_servidor));
No newline at end of file
87 if (resultado== -1){
No newline at end of file
88 ERROR_FATAL("No se establecio correctamente el socket: bind()");
No newline at end of file
89 }
No newline at end of file
90
No newline at end of file
91 /* Inicializamos el puerto GPIO del sistema embebido GSBC-9260S */
No newline at end of file
92 inicializa_gpio();
No newline at end of file
93
No newline at end of file
94 while(1){
No newline at end of file
95 LOG_SERVIDOR("Esperando solicitud de cliente...\n");
No newline at end of file
96
No newline at end of file
97 /* Se espera hasta que un cliente se conecte */
No newline at end of file
98 addr_len = sizeof(inf_cliente);
No newline at end of file
99 numbytes_recibidos = recvfrom(conexion_servidorFd, buff_peticion, TAM_BUFFER-1, 0, (struct sockaddr *)&inf_cliente, &addr_len);
No newline at end of file
100 if (numbytes_recibidos == -1){
No newline at end of file
101 ERROR_FATAL("Error en la recepcion de datos: recvfrom()");
No newline at end of file
102 }
No newline at end of file
103
No newline at end of file
104 /* Se procede a procesar los datos recibidos */
No newline at end of file
105 buff_peticion[numbytes_recibidos]= '\0';
No newline at end of file
106
No newline at end of file
107 /* procesamiento de la peticion */
No newline at end of file
108 rpta = procesa_peticion(buff_peticion);
No newline at end of file
109
No newline at end of file
110 //Respuesta del modulo de control
No newline at end of file
111 //
No newline at end of file
112
No newline at end of file
113
No newline at end of file
114 }
No newline at end of file
115 }
No newline at end of file
116
No newline at end of file
117
No newline at end of file
118
No newline at end of file
119 /*
No newline at end of file
120 * Esta funcion incializa el puerto GPIO
No newline at end of file
121 */
No newline at end of file
122 void inicializa_gpio(){
No newline at end of file
123
No newline at end of file
124 // Configuracion de los pines de APUNTE
No newline at end of file
125 pioc = pio_map(PIOC_BASE);
No newline at end of file
126 pio_enable(pioc, maskc_out);
No newline at end of file
127 pio_disable_irq(pioc, maskc_out);
No newline at end of file
128 pio_disable_multiple_driver(pioc, maskc_out);
No newline at end of file
129 pio_disable_pull_ups(pioc, maskc_out);
No newline at end of file
130 pio_synchronous_data_output(pioc, maskc_out);
No newline at end of file
131 pio_output_enable(pioc, maskc_out);
No newline at end of file
132
No newline at end of file
133 // Configuracion de los pines de VERIFICACION
No newline at end of file
134 piob = pio_map(PIOB_BASE);
No newline at end of file
135 pio_enable(piob, maskb_in);
No newline at end of file
136 pio_disable_irq(piob, maskb_in);
No newline at end of file
137 pio_disable_multiple_driver(piob, maskb_in);
No newline at end of file
138 pio_disable_pull_ups(piob, maskb_in);
No newline at end of file
139 pio_input_enable(piob, maskb_in);
No newline at end of file
140
No newline at end of file
141 }
No newline at end of file
142
No newline at end of file
143 /*
No newline at end of file
144 * Esta funcion procesa el mensaje de peticion y genera respuesta
No newline at end of file
145 */
No newline at end of file
146 int procesa_peticion(char *buff_peticion){
No newline at end of file
147 int rpta;
No newline at end of file
148 // char *header = strtok(buff_peticion, ":");
No newline at end of file
149 // char *ipSource = strtok(buff_peticion, ":");
No newline at end of file
150 // char *ipDestino = strtok(buff_peticion, ":");
No newline at end of file
151 char *comando = strtok(buff_peticion, ":");
No newline at end of file
152 char *valor = strtok(NULL, ":");
No newline at end of file
153
No newline at end of file
154 if ((comando == NULL) || (valor == NULL)){
No newline at end of file
155 ERROR("procesarPeticion: formato de mensaje incorrecto");
No newline at end of file
156 }
No newline at end of file
157 else{
No newline at end of file
158 if(strcmp(comando,"CARGA") == 0)
No newline at end of file
159 rpta = carga_experimento(valor);
No newline at end of file
160 else if(strcmp(comando,"CAMBIA") == 0)
No newline at end of file
161 rpta = cambia_apuntamiento(valor);
No newline at end of file
162 else if(strcmp(comando,"CHEQUEO") == 0)
No newline at end of file
163 rpta = chequeo_sistema(valor);
No newline at end of file
164 else
No newline at end of file
165 ERROR("procesa_peticion: comando no reconocido");
No newline at end of file
166 }
No newline at end of file
167
No newline at end of file
168 return rpta;
No newline at end of file
169 }
No newline at end of file
170
No newline at end of file
171
No newline at end of file
172 /*
No newline at end of file
173 * Esta funcion carga un archivo en un buffer que esta ubicado en memoria, luego
No newline at end of file
174 * este buffer es usado en la funcion "cambia_apuntamiento" para obtener el dato
No newline at end of file
175 * que sera usado en el cambio de apuntamiento.
No newline at end of file
176 */
No newline at end of file
177 int carga_experimento(char *nombre_archivo){
No newline at end of file
178
No newline at end of file
179 FILE *Archivo_Fd;
No newline at end of file
180
No newline at end of file
181 char *cadena = (char *) malloc(25);
No newline at end of file
182
No newline at end of file
183 int longitud_cadena;
No newline at end of file
184 int num_bytes= 0;
No newline at end of file
185 int num_filas= 0;
No newline at end of file
186
No newline at end of file
187 char ruta_archivo[50]; // Se crea la ruta para abrir el archivo
No newline at end of file
188 strcpy(ruta_archivo,"/mnt/sd/archivos/");
No newline at end of file
189 strcat(ruta_archivo,nombre_archivo);
No newline at end of file
190
No newline at end of file
191 Archivo_Fd = fopen(ruta_archivo,"r"); // Se procede a abrir el archivo, segun la ruta especificada
No newline at end of file
192 if(!Archivo_Fd){
No newline at end of file
193 ERROR("carga_archivo: No se pudo abrir el archivo!!! --> fopen()\n");
No newline at end of file
194 return -1;
No newline at end of file
195 }else{
No newline at end of file
196
No newline at end of file
197 while(!feof(Archivo_Fd)){ // Se procede a calcular la longitud del archivo para separar memoria
No newline at end of file
198 fgets(cadena,20,Archivo_Fd);
No newline at end of file
199 longitud_cadena= strlen(cadena);
No newline at end of file
200 cadena[longitud_cadena-1] = '\0';
No newline at end of file
201 num_bytes = num_bytes + longitud_cadena;
No newline at end of file
202 num_filas++;
No newline at end of file
203 }
No newline at end of file
204
No newline at end of file
205 rewind(Archivo_Fd); // Se reinicia el puntero del archivo
No newline at end of file
206
No newline at end of file
207 char *buffer_temporal = (char *) malloc(num_bytes+1); // Se separa espacio de memoria segun
No newline at end of file
208 // la longitud del archivo
No newline at end of file
209 fread(buffer_temporal, sizeof(char), num_bytes, Archivo_Fd);
No newline at end of file
210
No newline at end of file
211 char *puntero= strstr(buffer_temporal,".abs"); // Se procede a eliminar la cabecera del archivo
No newline at end of file
212 puntero= puntero + 12;
No newline at end of file
213
No newline at end of file
214 buff_experimento = (char *) malloc(7*(num_filas-3)); // num_bytes_fila*(num_filas-3);
No newline at end of file
215 strncpy(buff_experimento,puntero,7*(num_filas-3)); // Se carga en memoria la informacion del archivo
No newline at end of file
216
No newline at end of file
217 fclose(Archivo_Fd);
No newline at end of file
218
No newline at end of file
219 cambia_apuntamiento("0"); // Se apunta a la direccion 0
No newline at end of file
220
No newline at end of file
221 return 1;
No newline at end of file
222 }
No newline at end of file
223 }
No newline at end of file
224
No newline at end of file
225 /*
No newline at end of file
226 * Esta funcion recibe un numero en formato char, el dato se transforma a su equivalente en
No newline at end of file
227 * un numero entero, que sera usado para sacar un dato del buffer "buff_experimento", esta
No newline at end of file
228 * dato es el valor que se enviara al sistema de conmutacion RF para el cambio de apunte a
No newline at end of file
229 * traves del puerto GPIO.
No newline at end of file
230 */
No newline at end of file
231 int cambia_apuntamiento(char *puntero_char){
No newline at end of file
232
No newline at end of file
233 /*MSB-UP-LSB MSB-DOWN-LSB*/
No newline at end of file
234 int desplazamiento[6]={30,28,26,24,22,20}; // Defino los dezplazamientos que se aplicara
No newline at end of file
235 // al dato que ingresa para formar el número
No newline at end of file
236 // entero que se le pasara al puerto GPIO
No newline at end of file
237 // Estos números son los pines del puerto GPIO
No newline at end of file
238 // que se estan usando para el control
No newline at end of file
239
No newline at end of file
240 int puntero= atoi(puntero_char); // Se convierte a entero la direccion del puntero
No newline at end of file
241
No newline at end of file
242 int base= 7*puntero; // base= cantidad_bytes del dato x puntero
No newline at end of file
243 // cantidad de bytes es el numero de bytes que
No newline at end of file
244 printf("%i\n",puntero); // contiene cada dato, para este caso es 7
No newline at end of file
245 // porque es 6 bits de datos + 1 bit del cambio
No newline at end of file
246 // de linea.
No newline at end of file
247 char valor_char;
No newline at end of file
248 unsigned long valor;
No newline at end of file
249 unsigned long acumulado_ceros=0;
No newline at end of file
250 unsigned long acumulado_unos=0;
No newline at end of file
251
No newline at end of file
252 int offset; // Defino offset para el desplazamiento a traves
No newline at end of file
253 for(offset=0;offset<6;offset++){ // de cada dato que se obtiene del "buff_experimento"
No newline at end of file
254
No newline at end of file
255 valor_char= buff_experimento[base+offset]; // Obtengo el dato
No newline at end of file
256
No newline at end of file
257 if (valor_char == '0'){ // Obtengo el número acumulado segun sea un cero o un uno
No newline at end of file
258 valor= 0;
No newline at end of file
259 acumulado_ceros= acumulado_ceros + (1 << desplazamiento[offset]);
No newline at end of file
260 }else{
No newline at end of file
261 valor= 1;
No newline at end of file
262 acumulado_unos= acumulado_unos + (1 << desplazamiento[offset]);
No newline at end of file
263 }
No newline at end of file
264
No newline at end of file
265 }
No newline at end of file
266
No newline at end of file
267 pio_out(pioc, maskc_out, acumulado_unos, 1);
No newline at end of file
268 pio_out(pioc, maskc_out, acumulado_ceros, 0);
No newline at end of file
269
No newline at end of file
270 return 1;
No newline at end of file
271
No newline at end of file
272 }
No newline at end of file
273
No newline at end of file
274 /*
No newline at end of file
275 * Esta funcion lee "n" veces el estado del APUNTE actual y lo guarda en el
No newline at end of file
276 * archivo Verificacion.
No newline at end of file
277 */
No newline at end of file
278
No newline at end of file
279 int chequeo_sistema(char *numero_muestras){
No newline at end of file
280
No newline at end of file
281 char valor[7];
No newline at end of file
282 int i,cnt;
No newline at end of file
283 unsigned int entradac= 0;
No newline at end of file
284 FILE *fd;
No newline at end of file
285 fd=fopen("/mnt/sd/archivos/Verificacion","w");
No newline at end of file
286 fprintf(fd,"%s\n","Verificacion");
No newline at end of file
287 fprintf(fd,"%s\n","------------");
No newline at end of file
288 cnt=0;
No newline at end of file
289 do
No newline at end of file
290 {
No newline at end of file
291 //Inicializando arreglo
No newline at end of file
292 for(i=0;i<6;i++)
No newline at end of file
293 valor[i]='0';
No newline at end of file
294
No newline at end of file
295 valor[6]='\0';
No newline at end of file
296
No newline at end of file
297 //Lectura de puerto
No newline at end of file
298 entradac= pio_in(piob,maskb_in);
No newline at end of file
299
No newline at end of file
300 //Dandole formato al dato
No newline at end of file
301 if (!(entradac & bit_up_2))
No newline at end of file
302 valor[0] = '1';
No newline at end of file
303 if (!(entradac & bit_up_1))
No newline at end of file
304 valor[1] = '1';
No newline at end of file
305 if (!(entradac & bit_up_0))
No newline at end of file
306 valor[2] = '1';
No newline at end of file
307 if (!(entradac & bit_dow_2))
No newline at end of file
308 valor[3] = '1';
No newline at end of file
309 if (!(entradac & bit_dow_1))
No newline at end of file
310 valor[4] = '1';
No newline at end of file
311 if (!(entradac & bit_dow_0))
No newline at end of file
312 valor[5] = '1';
No newline at end of file
313
No newline at end of file
314 //Escribiendo en archivo
No newline at end of file
315 fprintf(fd,"%s\n",valor);
No newline at end of file
316 cnt=cnt+1;
No newline at end of file
317 usleep(1*1000*1000);
No newline at end of file
318
No newline at end of file
319 }while(cnt < atoi(numero_muestras));
No newline at end of file
320
No newline at end of file
321 fclose(fd);
No newline at end of file
322
No newline at end of file
323 return 1;
No newline at end of file
324 } No newline at end of file
@@ -1,219 +1,224
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?> No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <?fileVersion 4.0.0?> No newline at end of file
2 <?fileVersion 4.0.0?>
3 No newline at end of file
3
4 <cproject> No newline at end of file
4 <cproject>
5 <storageModule moduleId="org.eclipse.cdt.core.settings"> No newline at end of file
5 <storageModule moduleId="org.eclipse.cdt.core.settings">
6 <cconfiguration id="cdt.managedbuild.config.gnu.exe.release.1568263498"> No newline at end of file
6 <cconfiguration id="cdt.managedbuild.config.gnu.exe.release.1568263498">
7 <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.release.1568263498" moduleId="org.eclipse.cdt.core.settings" name="Release"> No newline at end of file
7 <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.release.1568263498" moduleId="org.eclipse.cdt.core.settings" name="Release">
8 <externalSettings/> No newline at end of file
8 <externalSettings/>
9 <extensions> No newline at end of file
9 <extensions>
10 <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> No newline at end of file
10 <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
11 <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> No newline at end of file
11 <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
12 <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> No newline at end of file
12 <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
13 <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> No newline at end of file
13 <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
14 <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> No newline at end of file
14 <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
15 </extensions> No newline at end of file
15 </extensions>
16 </storageModule> No newline at end of file
16 </storageModule>
17 <storageModule moduleId="cdtBuildSystem" version="4.0.0">
17 <storageModule moduleId="cdtBuildSystem" version="4.0.0">
No newline at end of file
18 <configuration artifactName="Control_Module_v1_debug" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.release.1568263498" name="Release" parent="cdt.managedbuild.config.gnu.exe.release"> No newline at end of file
18 <configuration artifactName="Control_Module" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.release.1568263498" name="Release" parent="cdt.managedbuild.config.gnu.exe.release"> No newline at end of file
19 <folderInfo id="cdt.managedbuild.config.gnu.exe.release.1568263498." name="/" resourcePath=""> No newline at end of file
19 <folderInfo id="cdt.managedbuild.config.gnu.exe.release.1568263498." name="/" resourcePath="">
20 <toolChain id="cdt.managedbuild.toolchain.gnu.exe.release.785297601" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.release"> No newline at end of file
20 <toolChain id="cdt.managedbuild.toolchain.gnu.exe.release.785297601" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.release">
21 <targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.release.1008424557" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.release"/> No newline at end of file
21 <targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.release.1008424557" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.release"/>
22 <builder buildPath="${workspace_loc:/Control_Module/Release}" id="cdt.managedbuild.target.gnu.builder.exe.release.365458410" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.exe.release"/> No newline at end of file
22 <builder buildPath="${workspace_loc:/Control_Module/Release}" id="cdt.managedbuild.target.gnu.builder.exe.release.365458410" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.exe.release"/>
23 <tool id="cdt.managedbuild.tool.gnu.archiver.base.1343949145" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/> No newline at end of file
23 <tool id="cdt.managedbuild.tool.gnu.archiver.base.1343949145" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
24 <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.57926565" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release"> No newline at end of file
24 <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.57926565" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release">
25 <option id="gnu.cpp.compiler.exe.release.option.optimization.level.35312113" name="Optimization Level" superClass="gnu.cpp.compiler.exe.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/> No newline at end of file
25 <option id="gnu.cpp.compiler.exe.release.option.optimization.level.35312113" name="Optimization Level" superClass="gnu.cpp.compiler.exe.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
26 <option id="gnu.cpp.compiler.exe.release.option.debugging.level.936269591" name="Debug Level" superClass="gnu.cpp.compiler.exe.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/> No newline at end of file
26 <option id="gnu.cpp.compiler.exe.release.option.debugging.level.936269591" name="Debug Level" superClass="gnu.cpp.compiler.exe.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
27 </tool> No newline at end of file
27 </tool>
28 <tool command="arm-unknown-linux-gnu-gcc" id="cdt.managedbuild.tool.gnu.c.compiler.exe.release.1796829929" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.release"> No newline at end of file
28 <tool command="arm-unknown-linux-gnu-gcc" id="cdt.managedbuild.tool.gnu.c.compiler.exe.release.1796829929" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.release">
29 <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.exe.release.option.optimization.level.499243164" name="Optimization Level" superClass="gnu.c.compiler.exe.release.option.optimization.level" valueType="enumerated"/> No newline at end of file
29 <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.exe.release.option.optimization.level.499243164" name="Optimization Level" superClass="gnu.c.compiler.exe.release.option.optimization.level" valueType="enumerated"/>
30 <option id="gnu.c.compiler.exe.release.option.debugging.level.1960011250" name="Debug Level" superClass="gnu.c.compiler.exe.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/> No newline at end of file
30 <option id="gnu.c.compiler.exe.release.option.debugging.level.1960011250" name="Debug Level" superClass="gnu.c.compiler.exe.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
31 <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1347535566" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> No newline at end of file
31 <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1347535566" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
32 </tool> No newline at end of file
32 </tool>
33 <tool command="arm-unknown-linux-gnu-gcc" id="cdt.managedbuild.tool.gnu.c.linker.exe.release.1288648685" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.release"> No newline at end of file
33 <tool command="arm-unknown-linux-gnu-gcc" id="cdt.managedbuild.tool.gnu.c.linker.exe.release.1288648685" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.release">
34 <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.2046701530" superClass="cdt.managedbuild.tool.gnu.c.linker.input"> No newline at end of file
34 <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.2046701530" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
35 <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/> No newline at end of file
35 <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
36 <additionalInput kind="additionalinput" paths="$(LIBS)"/> No newline at end of file
36 <additionalInput kind="additionalinput" paths="$(LIBS)"/>
37 </inputType> No newline at end of file
37 </inputType>
38 <outputType id="cdt.managedbuild.tool.gnu.c.linker.output.439510446" outputPrefix="" superClass="cdt.managedbuild.tool.gnu.c.linker.output"/> No newline at end of file
38 </tool> No newline at end of file
39 </tool>
39 <tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.release.1068281678" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.release"/> No newline at end of file
40 <tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.release.1068281678" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.release"/>
40 <tool id="cdt.managedbuild.tool.gnu.assembler.exe.release.796779267" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.release"> No newline at end of file
41 <tool id="cdt.managedbuild.tool.gnu.assembler.exe.release.796779267" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.release">
41 <inputType id="cdt.managedbuild.tool.gnu.assembler.input.690094510" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> No newline at end of file
42 <inputType id="cdt.managedbuild.tool.gnu.assembler.input.690094510" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
42 </tool> No newline at end of file
43 </tool>
43 </toolChain> No newline at end of file
44 </toolChain>
44 </folderInfo> No newline at end of file
45 </folderInfo>
45 </configuration> No newline at end of file
46 </configuration>
46 </storageModule> No newline at end of file
47 </storageModule>
48
No newline at end of file
49 <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
No newline at end of file
50 <storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
No newline at end of file
51 <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
No newline at end of file
52 <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/> No newline at end of file
47 <storageModule moduleId="scannerConfiguration"> No newline at end of file
53 <storageModule moduleId="scannerConfiguration">
48 <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/> No newline at end of file
54 <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
49 <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> No newline at end of file
55 <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
50 <buildOutputProvider> No newline at end of file
56 <buildOutputProvider>
51 <openAction enabled="true" filePath=""/> No newline at end of file
57 <openAction enabled="true" filePath=""/>
52 <parser enabled="true"/> No newline at end of file
58 <parser enabled="true"/>
53 </buildOutputProvider> No newline at end of file
59 </buildOutputProvider>
54 <scannerInfoProvider id="specsFile"> No newline at end of file
60 <scannerInfoProvider id="specsFile">
55 <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> No newline at end of file
61 <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
56 <parser enabled="true"/> No newline at end of file
62 <parser enabled="true"/>
57 </scannerInfoProvider> No newline at end of file
63 </scannerInfoProvider>
58 </profile> No newline at end of file
64 </profile>
59 <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> No newline at end of file
65 <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
60 <buildOutputProvider> No newline at end of file
66 <buildOutputProvider>
61 <openAction enabled="true" filePath=""/> No newline at end of file
67 <openAction enabled="true" filePath=""/>
62 <parser enabled="true"/> No newline at end of file
68 <parser enabled="true"/>
63 </buildOutputProvider> No newline at end of file
69 </buildOutputProvider>
64 <scannerInfoProvider id="makefileGenerator"> No newline at end of file
70 <scannerInfoProvider id="makefileGenerator">
65 <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> No newline at end of file
71 <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
66 <parser enabled="true"/> No newline at end of file
72 <parser enabled="true"/>
67 </scannerInfoProvider> No newline at end of file
73 </scannerInfoProvider>
68 </profile> No newline at end of file
74 </profile>
69 <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> No newline at end of file
75 <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
70 <buildOutputProvider> No newline at end of file
76 <buildOutputProvider>
71 <openAction enabled="true" filePath=""/> No newline at end of file
77 <openAction enabled="true" filePath=""/>
72 <parser enabled="true"/> No newline at end of file
78 <parser enabled="true"/>
73 </buildOutputProvider> No newline at end of file
79 </buildOutputProvider>
74 <scannerInfoProvider id="specsFile"> No newline at end of file
80 <scannerInfoProvider id="specsFile">
75 <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> No newline at end of file
81 <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
76 <parser enabled="true"/> No newline at end of file
82 <parser enabled="true"/>
77 </scannerInfoProvider> No newline at end of file
83 </scannerInfoProvider>
78 </profile> No newline at end of file
84 </profile>
79 <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> No newline at end of file
85 <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
80 <buildOutputProvider> No newline at end of file
86 <buildOutputProvider>
81 <openAction enabled="true" filePath=""/> No newline at end of file
87 <openAction enabled="true" filePath=""/>
82 <parser enabled="true"/> No newline at end of file
88 <parser enabled="true"/>
83 </buildOutputProvider> No newline at end of file
89 </buildOutputProvider>
84 <scannerInfoProvider id="specsFile"> No newline at end of file
90 <scannerInfoProvider id="specsFile">
85 <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> No newline at end of file
91 <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
86 <parser enabled="true"/> No newline at end of file
92 <parser enabled="true"/>
87 </scannerInfoProvider> No newline at end of file
93 </scannerInfoProvider>
88 </profile> No newline at end of file
94 </profile>
89 <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> No newline at end of file
95 <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
90 <buildOutputProvider> No newline at end of file
96 <buildOutputProvider>
91 <openAction enabled="true" filePath=""/> No newline at end of file
97 <openAction enabled="true" filePath=""/>
92 <parser enabled="true"/> No newline at end of file
98 <parser enabled="true"/>
93 </buildOutputProvider> No newline at end of file
99 </buildOutputProvider>
94 <scannerInfoProvider id="specsFile"> No newline at end of file
100 <scannerInfoProvider id="specsFile">
95 <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> No newline at end of file
101 <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
96 <parser enabled="true"/> No newline at end of file
102 <parser enabled="true"/>
97 </scannerInfoProvider> No newline at end of file
103 </scannerInfoProvider>
98 </profile> No newline at end of file
104 </profile>
99 <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> No newline at end of file
105 <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
100 <buildOutputProvider> No newline at end of file
106 <buildOutputProvider>
101 <openAction enabled="true" filePath=""/> No newline at end of file
107 <openAction enabled="true" filePath=""/>
102 <parser enabled="true"/> No newline at end of file
108 <parser enabled="true"/>
103 </buildOutputProvider> No newline at end of file
109 </buildOutputProvider>
104 <scannerInfoProvider id="specsFile"> No newline at end of file
110 <scannerInfoProvider id="specsFile">
105 <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> No newline at end of file
111 <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
106 <parser enabled="true"/> No newline at end of file
112 <parser enabled="true"/>
107 </scannerInfoProvider> No newline at end of file
113 </scannerInfoProvider>
108 </profile> No newline at end of file
114 </profile>
109 <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> No newline at end of file
115 <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
110 <buildOutputProvider> No newline at end of file
116 <buildOutputProvider>
111 <openAction enabled="true" filePath=""/> No newline at end of file
117 <openAction enabled="true" filePath=""/>
112 <parser enabled="true"/> No newline at end of file
118 <parser enabled="true"/>
113 </buildOutputProvider> No newline at end of file
119 </buildOutputProvider>
114 <scannerInfoProvider id="specsFile"> No newline at end of file
120 <scannerInfoProvider id="specsFile">
115 <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> No newline at end of file
121 <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
116 <parser enabled="true"/> No newline at end of file
122 <parser enabled="true"/>
117 </scannerInfoProvider> No newline at end of file
123 </scannerInfoProvider>
118 </profile> No newline at end of file
124 </profile>
119 <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> No newline at end of file
125 <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
120 <buildOutputProvider> No newline at end of file
126 <buildOutputProvider>
121 <openAction enabled="true" filePath=""/> No newline at end of file
127 <openAction enabled="true" filePath=""/>
122 <parser enabled="true"/> No newline at end of file
128 <parser enabled="true"/>
123 </buildOutputProvider> No newline at end of file
129 </buildOutputProvider>
124 <scannerInfoProvider id="specsFile"> No newline at end of file
130 <scannerInfoProvider id="specsFile">
125 <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> No newline at end of file
131 <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
126 <parser enabled="true"/> No newline at end of file
132 <parser enabled="true"/>
127 </scannerInfoProvider> No newline at end of file
133 </scannerInfoProvider>
128 </profile> No newline at end of file
134 </profile>
129 <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.1568263498;cdt.managedbuild.config.gnu.exe.release.1568263498.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.1796829929;cdt.managedbuild.tool.gnu.c.compiler.input.1347535566"> No newline at end of file
135 <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.1568263498;cdt.managedbuild.config.gnu.exe.release.1568263498.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.1796829929;cdt.managedbuild.tool.gnu.c.compiler.input.1347535566">
130 <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/> No newline at end of file
136 <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
131 <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> No newline at end of file
137 <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
132 <buildOutputProvider> No newline at end of file
138 <buildOutputProvider>
133 <openAction enabled="true" filePath=""/> No newline at end of file
139 <openAction enabled="true" filePath=""/>
134 <parser enabled="true"/> No newline at end of file
140 <parser enabled="true"/>
135 </buildOutputProvider> No newline at end of file
141 </buildOutputProvider>
136 <scannerInfoProvider id="specsFile"> No newline at end of file
142 <scannerInfoProvider id="specsFile">
137 <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> No newline at end of file
143 <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
138 <parser enabled="true"/> No newline at end of file
144 <parser enabled="true"/>
139 </scannerInfoProvider> No newline at end of file
145 </scannerInfoProvider>
140 </profile> No newline at end of file
146 </profile>
141 <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> No newline at end of file
147 <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
142 <buildOutputProvider> No newline at end of file
148 <buildOutputProvider>
143 <openAction enabled="true" filePath=""/> No newline at end of file
149 <openAction enabled="true" filePath=""/>
144 <parser enabled="true"/> No newline at end of file
150 <parser enabled="true"/>
145 </buildOutputProvider> No newline at end of file
151 </buildOutputProvider>
146 <scannerInfoProvider id="makefileGenerator"> No newline at end of file
152 <scannerInfoProvider id="makefileGenerator">
147 <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> No newline at end of file
153 <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
148 <parser enabled="true"/> No newline at end of file
154 <parser enabled="true"/>
149 </scannerInfoProvider> No newline at end of file
155 </scannerInfoProvider>
150 </profile> No newline at end of file
156 </profile>
151 <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> No newline at end of file
157 <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
152 <buildOutputProvider> No newline at end of file
158 <buildOutputProvider>
153 <openAction enabled="true" filePath=""/> No newline at end of file
159 <openAction enabled="true" filePath=""/>
154 <parser enabled="true"/> No newline at end of file
160 <parser enabled="true"/>
155 </buildOutputProvider> No newline at end of file
161 </buildOutputProvider>
156 <scannerInfoProvider id="specsFile"> No newline at end of file
162 <scannerInfoProvider id="specsFile">
157 <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> No newline at end of file
163 <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
158 <parser enabled="true"/> No newline at end of file
164 <parser enabled="true"/>
159 </scannerInfoProvider> No newline at end of file
165 </scannerInfoProvider>
160 </profile> No newline at end of file
166 </profile>
161 <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> No newline at end of file
167 <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
162 <buildOutputProvider> No newline at end of file
168 <buildOutputProvider>
163 <openAction enabled="true" filePath=""/> No newline at end of file
169 <openAction enabled="true" filePath=""/>
164 <parser enabled="true"/> No newline at end of file
170 <parser enabled="true"/>
165 </buildOutputProvider> No newline at end of file
171 </buildOutputProvider>
166 <scannerInfoProvider id="specsFile"> No newline at end of file
172 <scannerInfoProvider id="specsFile">
167 <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> No newline at end of file
173 <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
168 <parser enabled="true"/> No newline at end of file
174 <parser enabled="true"/>
169 </scannerInfoProvider> No newline at end of file
175 </scannerInfoProvider>
170 </profile> No newline at end of file
176 </profile>
171 <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> No newline at end of file
177 <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
172 <buildOutputProvider> No newline at end of file
178 <buildOutputProvider>
173 <openAction enabled="true" filePath=""/> No newline at end of file
179 <openAction enabled="true" filePath=""/>
174 <parser enabled="true"/> No newline at end of file
180 <parser enabled="true"/>
175 </buildOutputProvider> No newline at end of file
181 </buildOutputProvider>
176 <scannerInfoProvider id="specsFile"> No newline at end of file
182 <scannerInfoProvider id="specsFile">
177 <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> No newline at end of file
183 <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
178 <parser enabled="true"/> No newline at end of file
184 <parser enabled="true"/>
179 </scannerInfoProvider> No newline at end of file
185 </scannerInfoProvider>
180 </profile> No newline at end of file
186 </profile>
181 <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> No newline at end of file
187 <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
182 <buildOutputProvider> No newline at end of file
188 <buildOutputProvider>
183 <openAction enabled="true" filePath=""/> No newline at end of file
189 <openAction enabled="true" filePath=""/>
184 <parser enabled="true"/> No newline at end of file
190 <parser enabled="true"/>
185 </buildOutputProvider> No newline at end of file
191 </buildOutputProvider>
186 <scannerInfoProvider id="specsFile"> No newline at end of file
192 <scannerInfoProvider id="specsFile">
187 <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> No newline at end of file
193 <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
188 <parser enabled="true"/> No newline at end of file
194 <parser enabled="true"/>
189 </scannerInfoProvider> No newline at end of file
195 </scannerInfoProvider>
190 </profile> No newline at end of file
196 </profile>
191 <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> No newline at end of file
197 <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
192 <buildOutputProvider> No newline at end of file
198 <buildOutputProvider>
193 <openAction enabled="true" filePath=""/> No newline at end of file
199 <openAction enabled="true" filePath=""/>
194 <parser enabled="true"/> No newline at end of file
200 <parser enabled="true"/>
195 </buildOutputProvider> No newline at end of file
201 </buildOutputProvider>
196 <scannerInfoProvider id="specsFile"> No newline at end of file
202 <scannerInfoProvider id="specsFile">
197 <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> No newline at end of file
203 <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
198 <parser enabled="true"/> No newline at end of file
204 <parser enabled="true"/>
199 </scannerInfoProvider> No newline at end of file
205 </scannerInfoProvider>
200 </profile> No newline at end of file
206 </profile>
201 <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> No newline at end of file
207 <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
202 <buildOutputProvider> No newline at end of file
208 <buildOutputProvider>
203 <openAction enabled="true" filePath=""/> No newline at end of file
209 <openAction enabled="true" filePath=""/>
204 <parser enabled="true"/> No newline at end of file
210 <parser enabled="true"/>
205 </buildOutputProvider> No newline at end of file
211 </buildOutputProvider>
206 <scannerInfoProvider id="specsFile"> No newline at end of file
212 <scannerInfoProvider id="specsFile">
207 <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> No newline at end of file
213 <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
208 <parser enabled="true"/> No newline at end of file
214 <parser enabled="true"/>
209 </scannerInfoProvider> No newline at end of file
215 </scannerInfoProvider>
210 </profile> No newline at end of file
216 </profile>
211 </scannerConfigBuildInfo> No newline at end of file
217 </scannerConfigBuildInfo>
212 </storageModule>
218 </storageModule>
No newline at end of file
213 <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> No newline at end of file
214 </cconfiguration> No newline at end of file
219 </cconfiguration>
215 </storageModule> No newline at end of file
220 </storageModule>
216 <storageModule moduleId="cdtBuildSystem" version="4.0.0"> No newline at end of file
221 <storageModule moduleId="cdtBuildSystem" version="4.0.0">
217 <project id="Control_Module.cdt.managedbuild.target.gnu.exe.1941602615" name="Executable" projectType="cdt.managedbuild.target.gnu.exe"/> No newline at end of file
222 <project id="Control_Module.cdt.managedbuild.target.gnu.exe.1941602615" name="Executable" projectType="cdt.managedbuild.target.gnu.exe"/>
218 </storageModule> No newline at end of file
223 </storageModule>
219 </cproject> No newline at end of file
224 </cproject>
@@ -1,322 +1,339
1 /* No newline at end of file
1 /*
2 * Servidor.c No newline at end of file
2 * Servidor.c
3 * No newline at end of file
3 *
4 * Created on: Nov 3, 2009 No newline at end of file
4 * Created on: Nov 3, 2009
5 * Author: Jose Francisco Quenta No newline at end of file
5 * Author: Jose Francisco Quenta
6 * No newline at end of file
6 *
7 * Se implementa: No newline at end of file
7 * Se implementa:
8 * -Carga en memoria los apuntes contenidos en un archivo de experimentos: apunte0 -> GPIO No newline at end of file
8 * -Carga en memoria los apuntes contenidos en un archivo de experimentos: apunte0 -> GPIO
9 * -Cambio de apunte. No newline at end of file
9 * -Cambio de apunte.
10 * -Lectura del estado actual del apunte y grabado del mismo en un archivo No newline at end of file
10 * -Lectura del estado actual del apunte y grabado del mismo en un archivo
11 */ No newline at end of file
11 */
12 No newline at end of file
12
13 #include <stdio.h> No newline at end of file
13 #include <stdio.h>
14 #include <stdlib.h> No newline at end of file
14 #include <stdlib.h>
15 #include <string.h> No newline at end of file
15 #include <string.h>
16 #include <unistd.h> No newline at end of file
16 #include <unistd.h>
17 #include <errno.h> No newline at end of file
17 #include <errno.h>
18 No newline at end of file
18
19 #include <sys/types.h> No newline at end of file
19 #include <sys/types.h>
20 #include <sys/socket.h> No newline at end of file
20 #include <sys/socket.h>
21 #include <netinet/in.h> No newline at end of file
21 #include <netinet/in.h>
22 #include <arpa/inet.h> No newline at end of file
22 #include <arpa/inet.h>
23 #include <netdb.h> No newline at end of file
23 #include <netdb.h>
24 No newline at end of file
24
25 #include "./Librerias/AT91gpio_Funciones.h" No newline at end of file
25 #include "./Librerias/AT91gpio_Funciones.h"
26 #include "./Librerias/Mensajes.h" No newline at end of file
26 #include "./Librerias/Mensajes.h"
27 No newline at end of file
27
28 #define PUERTO_SERVIDOR 5500 No newline at end of file
28 #define PUERTO_SERVIDOR 5500
29 #define TAM_BUFFER 100 No newline at end of file
29 #define TAM_BUFFER 100
30 No newline at end of file
30
31 #define maskc_out PC30+PC28+PC26+PC24+PC22+PC20 //MSB-UP-LSB MSB-DOWN-LSB //APUNTE No newline at end of file
31 #define maskc_out PC30+PC28+PC26+PC24+PC22+PC20 //MSB-UP-LSB MSB-DOWN-LSB //APUNTE
32 No newline at end of file
32
33 #define maskb_in PB16+PB18+PB20+PB30+PB24+PB22 //MSB-UP-LSB MSB-DOWN-LSB //VERIFICACION No newline at end of file
33 #define maskb_in PB16+PB18+PB20+PB30+PB24+PB22 //MSB-UP-LSB MSB-DOWN-LSB //VERIFICACION
34 No newline at end of file
34
35 #define bit_up_2 0x00010000 //Mascara de cada bit a revisar: bit_up_2 es MSB No newline at end of file
35 #define bit_up_2 0x00010000 //Mascara de cada bit a revisar: bit_up_2 es MSB
36 #define bit_up_1 0x00040000 No newline at end of file
36 #define bit_up_1 0x00040000
37 #define bit_up_0 0x00100000 No newline at end of file
37 #define bit_up_0 0x00100000
38 #define bit_dow_2 0x40000000 No newline at end of file
38 #define bit_dow_2 0x40000000
39 #define bit_dow_1 0x01000000 No newline at end of file
39 #define bit_dow_1 0x01000000
40 #define bit_dow_0 0x00400000 No newline at end of file
40 #define bit_dow_0 0x00400000
41 No newline at end of file
41
42 #define MyID 11 No newline at end of file
42 #define MyID 11
43 No newline at end of file
43
44 char *buff_experimento= NULL; No newline at end of file
44 char *buff_experimento= NULL;
45 No newline at end of file
45
46 AT91S_PIO *pioc; No newline at end of file
46 AT91S_PIO *pioc;
47 AT91S_PIO *piob; No newline at end of file
47 AT91S_PIO *piob;
48 No newline at end of file
48
49 /* No newline at end of file
49 /*
50 * Zona de declaracion de cabeceras. No newline at end of file
50 * Zona de declaracion de cabeceras.
51 */ No newline at end of file
51 */
52 void inicializa_gpio();
52 void inicializa_gpio();
No newline at end of file
53 //int procesa_peticion(char *buff_peticion);
53 int procesa_peticion(char *buff_peticion);
No newline at end of file
No newline at end of file
54 void procesa_peticion(char *buff_peticion);
54 int cambia_apuntamiento(char *puntero_char);
No newline at end of file
No newline at end of file
55 //int cambia_apuntamiento(char *puntero_char);
55 int carga_experimento(char *nombre_archivo);
No newline at end of file
No newline at end of file
56 void cambia_apuntamiento(char *puntero_char);
56 int chequeo_sistema(char *numero_muestras); No newline at end of file
No newline at end of file
57 //int carga_experimento(char *nombre_archivo);
No newline at end of file
58 void carga_experimento(char *nombre_archivo);
No newline at end of file
59 //int chequeo_sistema(char *numero_muestras);
No newline at end of file
60 void chequeo_sistema(char *numero_muestras); No newline at end of file
57 No newline at end of file
61
58 /* No newline at end of file
62 /*
59 * No newline at end of file
63 *
60 */ No newline at end of file
64 */
61 int main(){ No newline at end of file
65 int main(){
62 No newline at end of file
66
63 int conexion_servidorFd; No newline at end of file
67 int conexion_servidorFd;
64 struct sockaddr_in inf_servidor; No newline at end of file
68 struct sockaddr_in inf_servidor;
65 struct sockaddr_storage inf_cliente; No newline at end of file
69 struct sockaddr_storage inf_cliente;
66 int resultado; No newline at end of file
70 int resultado;
67 int numbytes_recibidos;
71 int numbytes_recibidos;
No newline at end of file
72 //int rpta; No newline at end of file
68 int rpta; No newline at end of file
69 No newline at end of file
73
70 char *buff_peticion = (char *) malloc(TAM_BUFFER); No newline at end of file
74 char *buff_peticion = (char *) malloc(TAM_BUFFER);
71 No newline at end of file
75
72 size_t addr_len; No newline at end of file
76 size_t addr_len;
73 No newline at end of file
77
74 memset(&inf_servidor, 0, sizeof(inf_servidor)); No newline at end of file
78 memset(&inf_servidor, 0, sizeof(inf_servidor));
75 inf_servidor.sin_family= AF_INET; No newline at end of file
79 inf_servidor.sin_family= AF_INET;
76 inf_servidor.sin_port= htons(PUERTO_SERVIDOR); No newline at end of file
80 inf_servidor.sin_port= htons(PUERTO_SERVIDOR);
77 inf_servidor.sin_addr.s_addr= INADDR_ANY; No newline at end of file
81 inf_servidor.sin_addr.s_addr= INADDR_ANY;
78 No newline at end of file
82
79 /* Se establece el socket */ No newline at end of file
83 /* Se establece el socket */
80 conexion_servidorFd = socket(AF_INET,SOCK_DGRAM,0); No newline at end of file
84 conexion_servidorFd = socket(AF_INET,SOCK_DGRAM,0);
81 if (conexion_servidorFd == -1){ No newline at end of file
85 if (conexion_servidorFd == -1){
82 ERROR_FATAL("No se establecio correctamente el socket: socket()"); No newline at end of file
86 ERROR_FATAL("No se establecio correctamente el socket: socket()");
83 } No newline at end of file
87 }
84 No newline at end of file
88
85 /* Se asocia el socket a un puerto y una IP */ No newline at end of file
89 /* Se asocia el socket a un puerto y una IP */
86 resultado = bind(conexion_servidorFd,(struct sockaddr *)&inf_servidor,sizeof(inf_servidor)); No newline at end of file
90 resultado = bind(conexion_servidorFd,(struct sockaddr *)&inf_servidor,sizeof(inf_servidor));
87 if (resultado== -1){ No newline at end of file
91 if (resultado== -1){
88 ERROR_FATAL("No se establecio correctamente el socket: bind()"); No newline at end of file
92 ERROR_FATAL("No se establecio correctamente el socket: bind()");
89 } No newline at end of file
93 }
90 No newline at end of file
94
91 /* Inicializamos el puerto GPIO del sistema embebido GSBC-9260S */ No newline at end of file
95 /* Inicializamos el puerto GPIO del sistema embebido GSBC-9260S */
92 inicializa_gpio(); No newline at end of file
96 inicializa_gpio();
93 No newline at end of file
97
94 while(1){ No newline at end of file
98 while(1){
95 LOG_SERVIDOR("Esperando solicitud de cliente...\n"); No newline at end of file
99 LOG_SERVIDOR("Esperando solicitud de cliente...\n");
96 No newline at end of file
100
97 /* Se espera hasta que un cliente se conecte */ No newline at end of file
101 /* Se espera hasta que un cliente se conecte */
98 addr_len = sizeof(inf_cliente); No newline at end of file
102 addr_len = sizeof(inf_cliente);
99 numbytes_recibidos = recvfrom(conexion_servidorFd, buff_peticion, TAM_BUFFER-1, 0, (struct sockaddr *)&inf_cliente, &addr_len); No newline at end of file
103 numbytes_recibidos = recvfrom(conexion_servidorFd, buff_peticion, TAM_BUFFER-1, 0, (struct sockaddr *)&inf_cliente, &addr_len);
100 if (numbytes_recibidos == -1){ No newline at end of file
104 if (numbytes_recibidos == -1){
101 ERROR_FATAL("Error en la recepcion de datos: recvfrom()");
105 ERROR_FATAL("Error en la recepcion de datos: recvfrom()");
No newline at end of file
106 }else
102 } No newline at end of file
No newline at end of file
107 printf("Recibidos: %i\n",numbytes_recibidos); No newline at end of file
103 No newline at end of file
108
104 /* Se procede a procesar los datos recibidos */ No newline at end of file
109 /* Se procede a procesar los datos recibidos */
105 buff_peticion[numbytes_recibidos]= '\0'; No newline at end of file
110 buff_peticion[numbytes_recibidos]= '\0';
111 printf("%s\n",buff_peticion); No newline at end of file
106 No newline at end of file
112
107 /* procesamiento de la peticion */
113 /* procesamiento de la peticion */
No newline at end of file
114 //rpta = procesa_peticion(buff_peticion);
108 rpta = procesa_peticion(buff_peticion); No newline at end of file
No newline at end of file
115 procesa_peticion(buff_peticion); No newline at end of file
109 No newline at end of file
116
110 //Respuesta del modulo de control No newline at end of file
117 //Respuesta del modulo de control
111 // No newline at end of file
118 //
112 No newline at end of file
119
113 No newline at end of file
120
114 } No newline at end of file
121 }
115 } No newline at end of file
122 }
116 No newline at end of file
123
117 /* No newline at end of file
124 /*
118 * Esta funcion incializa el puerto GPIO No newline at end of file
125 * Esta funcion incializa el puerto GPIO
119 */ No newline at end of file
126 */
120 void inicializa_gpio(){ No newline at end of file
127 void inicializa_gpio(){
121 No newline at end of file
128
122 // Configuracion de los pines de APUNTE No newline at end of file
129 // Configuracion de los pines de APUNTE
123 pioc = pio_map(PIOC_BASE); No newline at end of file
130 pioc = pio_map(PIOC_BASE);
124 pio_enable(pioc, maskc_out); No newline at end of file
131 pio_enable(pioc, maskc_out);
125 pio_disable_irq(pioc, maskc_out); No newline at end of file
132 pio_disable_irq(pioc, maskc_out);
126 pio_disable_multiple_driver(pioc, maskc_out); No newline at end of file
133 pio_disable_multiple_driver(pioc, maskc_out);
127 pio_disable_pull_ups(pioc, maskc_out); No newline at end of file
134 pio_disable_pull_ups(pioc, maskc_out);
128 pio_synchronous_data_output(pioc, maskc_out); No newline at end of file
135 pio_synchronous_data_output(pioc, maskc_out);
129 pio_output_enable(pioc, maskc_out); No newline at end of file
136 pio_output_enable(pioc, maskc_out);
130 No newline at end of file
137
131 // Configuracion de los pines de VERIFICACION No newline at end of file
138 // Configuracion de los pines de VERIFICACION
132 piob = pio_map(PIOB_BASE); No newline at end of file
139 piob = pio_map(PIOB_BASE);
133 pio_enable(piob, maskb_in); No newline at end of file
140 pio_enable(piob, maskb_in);
134 pio_disable_irq(piob, maskb_in); No newline at end of file
141 pio_disable_irq(piob, maskb_in);
135 pio_disable_multiple_driver(piob, maskb_in); No newline at end of file
142 pio_disable_multiple_driver(piob, maskb_in);
136 pio_disable_pull_ups(piob, maskb_in); No newline at end of file
143 pio_disable_pull_ups(piob, maskb_in);
137 pio_input_enable(piob, maskb_in); No newline at end of file
144 pio_input_enable(piob, maskb_in);
138 No newline at end of file
145
139 } No newline at end of file
146 }
140 No newline at end of file
147
141 /* No newline at end of file
148 /*
142 * Esta funcion procesa el mensaje de peticion y genera respuesta No newline at end of file
149 * Esta funcion procesa el mensaje de peticion y genera respuesta
143 */
150 */
No newline at end of file
151 //int procesa_peticion(char *buff_peticion){
144 int procesa_peticion(char *buff_peticion){
No newline at end of file
No newline at end of file
152 void procesa_peticion(char *buff_peticion){
145 int rpta; No newline at end of file
No newline at end of file
153 //int rpta = 0;
No newline at end of file
154 No newline at end of file
146 // char *header = strtok(buff_peticion, ":"); No newline at end of file
155 // char *header = strtok(buff_peticion, ":");
147 // char *ipSource = strtok(buff_peticion, ":"); No newline at end of file
156 // char *ipSource = strtok(buff_peticion, ":");
148 // char *ipDestino = strtok(buff_peticion, ":"); No newline at end of file
157 // char *ipDestino = strtok(buff_peticion, ":");
149 char *comando = strtok(buff_peticion, ":"); No newline at end of file
158 char *comando = strtok(buff_peticion, ":");
150 char *valor = strtok(NULL, ":"); No newline at end of file
159 char *valor = strtok(NULL, ":");
151 No newline at end of file
160
161 printf("Testpoint_1\n"); No newline at end of file
152 if ((comando == NULL) || (valor == NULL)){ No newline at end of file
162 if ((comando == NULL) || (valor == NULL)){
153 ERROR("procesarPeticion: formato de mensaje incorrecto"); No newline at end of file
163 ERROR("procesarPeticion: formato de mensaje incorrecto");
154 } No newline at end of file
164 }
155 else{ No newline at end of file
165 else{
156 if(strcmp(comando,"CARGA") == 0)
166 if(strcmp(comando,"CARGA") == 0)
No newline at end of file
167 //rpta = carga_experimento(valor);
157 rpta = carga_experimento(valor); No newline at end of file
No newline at end of file
168 carga_experimento(valor); No newline at end of file
158 else if(strcmp(comando,"CAMBIA") == 0)
169 else if(strcmp(comando,"CAMBIA") == 0)
No newline at end of file
170 //rpta = cambia_apuntamiento(valor);
159 rpta = cambia_apuntamiento(valor); No newline at end of file
No newline at end of file
171 cambia_apuntamiento(valor); No newline at end of file
160 else if(strcmp(comando,"CHEQUEO") == 0)
172 else if(strcmp(comando,"CHEQUEO") == 0)
No newline at end of file
173 //rpta = chequeo_sistema(valor);
161 rpta = chequeo_sistema(valor); No newline at end of file
No newline at end of file
174 chequeo_sistema(valor); No newline at end of file
162 else No newline at end of file
175 else
163 ERROR("procesa_peticion: comando no reconocido"); No newline at end of file
176 ERROR("procesa_peticion: comando no reconocido");
164 } No newline at end of file
177 }
165
178
No newline at end of file
179 //return rpta; No newline at end of file
166 return rpta; No newline at end of file
167 } No newline at end of file
180 }
168 No newline at end of file
181
169 No newline at end of file
182
170 /* No newline at end of file
183 /*
171 * Esta funcion carga un archivo en un buffer que esta ubicado en memoria, luego No newline at end of file
184 * Esta funcion carga un archivo en un buffer que esta ubicado en memoria, luego
172 * este buffer es usado en la funcion "cambia_apuntamiento" para obtener el dato No newline at end of file
185 * este buffer es usado en la funcion "cambia_apuntamiento" para obtener el dato
173 * que sera usado en el cambio de apuntamiento. No newline at end of file
186 * que sera usado en el cambio de apuntamiento.
174 */
187 */
No newline at end of file
188 //int carga_experimento(char *nombre_archivo){
175 int carga_experimento(char *nombre_archivo){ No newline at end of file
No newline at end of file
189 void carga_experimento(char *nombre_archivo){ No newline at end of file
176 No newline at end of file
190
177 FILE *Archivo_Fd; No newline at end of file
191 FILE *Archivo_Fd;
178 No newline at end of file
192
179 char *cadena = (char *) malloc(25); No newline at end of file
193 char *cadena = (char *) malloc(25);
180 No newline at end of file
194
181 int longitud_cadena; No newline at end of file
195 int longitud_cadena;
182 int num_bytes= 0; No newline at end of file
196 int num_bytes= 0;
183 int num_filas= 0; No newline at end of file
197 int num_filas= 0;
184 No newline at end of file
198
185 char ruta_archivo[50]; // Se crea la ruta para abrir el archivo No newline at end of file
199 char ruta_archivo[50]; // Se crea la ruta para abrir el archivo
186 strcpy(ruta_archivo,"/mnt/sd/archivos/"); No newline at end of file
200 strcpy(ruta_archivo,"/mnt/sd/archivos/");
187 strcat(ruta_archivo,nombre_archivo); No newline at end of file
201 strcat(ruta_archivo,nombre_archivo);
188 No newline at end of file
202
189 Archivo_Fd = fopen(ruta_archivo,"r"); // Se procede a abrir el archivo, segun la ruta especificada No newline at end of file
203 Archivo_Fd = fopen(ruta_archivo,"r"); // Se procede a abrir el archivo, segun la ruta especificada
190 if(!Archivo_Fd){ No newline at end of file
204 if(!Archivo_Fd){
191 ERROR("carga_archivo: No se pudo abrir el archivo!!! --> fopen()\n");
205 ERROR("carga_archivo: No se pudo abrir el archivo!!! --> fopen()\n");
No newline at end of file
206 // return -1; No newline at end of file
192 return -1; No newline at end of file
193 }else{
207 }else{
No newline at end of file
208 printf("Testpoint_2\n"); No newline at end of file
194 No newline at end of file
195 while(!feof(Archivo_Fd)){ // Se procede a calcular la longitud del archivo para separar memoria No newline at end of file
209 while(!feof(Archivo_Fd)){ // Se procede a calcular la longitud del archivo para separar memoria
196 fgets(cadena,20,Archivo_Fd); No newline at end of file
210 fgets(cadena,20,Archivo_Fd);
197 longitud_cadena= strlen(cadena); No newline at end of file
211 longitud_cadena= strlen(cadena);
198 cadena[longitud_cadena-1] = '\0'; No newline at end of file
212 cadena[longitud_cadena-1] = '\0';
199 num_bytes = num_bytes + longitud_cadena; No newline at end of file
213 num_bytes = num_bytes + longitud_cadena;
200 num_filas++; No newline at end of file
214 num_filas++;
201 } No newline at end of file
215 }
202 No newline at end of file
216
203 rewind(Archivo_Fd); // Se reinicia el puntero del archivo No newline at end of file
217 rewind(Archivo_Fd); // Se reinicia el puntero del archivo
204 No newline at end of file
218
205 char *buffer_temporal = (char *) malloc(num_bytes+1); // Se separa espacio de memoria segun No newline at end of file
219 char *buffer_temporal = (char *) malloc(num_bytes+1); // Se separa espacio de memoria segun
206 // la longitud del archivo No newline at end of file
220 // la longitud del archivo
207 fread(buffer_temporal, sizeof(char), num_bytes, Archivo_Fd); No newline at end of file
221 fread(buffer_temporal, sizeof(char), num_bytes, Archivo_Fd);
208
222
No newline at end of file
223 printf("Testpoint_3\n");
209 char *puntero= strstr(buffer_temporal,".abs"); // Se procede a eliminar la cabecera del archivo No newline at end of file
No newline at end of file
224 char *puntero= strstr(buffer_temporal,".ab1"); // Se procede a eliminar la cabecera del archivo No newline at end of file
210 puntero= puntero + 12; No newline at end of file
225 puntero= puntero + 12;
211 No newline at end of file
226
212 buff_experimento = (char *) malloc(7*(num_filas-3)); // num_bytes_fila*(num_filas-3); No newline at end of file
227 buff_experimento = (char *) malloc(7*(num_filas-3)); // num_bytes_fila*(num_filas-3);
213 strncpy(buff_experimento,puntero,7*(num_filas-3)); // Se carga en memoria la informacion del archivo No newline at end of file
228 strncpy(buff_experimento,puntero,7*(num_filas-3)); // Se carga en memoria la informacion del archivo
214 No newline at end of file
229
215 fclose(Archivo_Fd); No newline at end of file
230 fclose(Archivo_Fd);
216
231
No newline at end of file
232 //cambia_apuntamiento("0"); // Se apunta a la direccion 0
217 cambia_apuntamiento("0"); // Se apunta a la direccion 0
No newline at end of file
No newline at end of file
233
218
No newline at end of file
No newline at end of file
234 // return 1; No newline at end of file
219 return 1; No newline at end of file
220 } No newline at end of file
235 }
221 } No newline at end of file
236 }
222 No newline at end of file
237
223 /* No newline at end of file
238 /*
224 * Esta funcion recibe un numero en formato char, el dato se transforma a su equivalente en No newline at end of file
239 * Esta funcion recibe un numero en formato char, el dato se transforma a su equivalente en
225 * un numero entero, que sera usado para sacar un dato del buffer "buff_experimento", esta No newline at end of file
240 * un numero entero, que sera usado para sacar un dato del buffer "buff_experimento", esta
226 * dato es el valor que se enviara al sistema de conmutacion RF para el cambio de apunte a No newline at end of file
241 * dato es el valor que se enviara al sistema de conmutacion RF para el cambio de apunte a
227 * traves del puerto GPIO. No newline at end of file
242 * traves del puerto GPIO.
228 */
243 */
No newline at end of file
244 //int cambia_apuntamiento(char *puntero_char){
229 int cambia_apuntamiento(char *puntero_char){ No newline at end of file
No newline at end of file
245 void cambia_apuntamiento(char *puntero_char){ No newline at end of file
230 No newline at end of file
246
231 /*MSB-UP-LSB MSB-DOWN-LSB*/ No newline at end of file
247 /*MSB-UP-LSB MSB-DOWN-LSB*/
232 int desplazamiento[6]={30,28,26,24,22,20}; // Defino los dezplazamientos que se aplicara No newline at end of file
248 int desplazamiento[6]={30,28,26,24,22,20}; // Defino los dezplazamientos que se aplicara
233 // al dato que ingresa para formar el número No newline at end of file
249 // al dato que ingresa para formar el número
234 // entero que se le pasara al puerto GPIO No newline at end of file
250 // entero que se le pasara al puerto GPIO
235 // Estos números son los pines del puerto GPIO No newline at end of file
251 // Estos números son los pines del puerto GPIO
236 // que se estan usando para el control No newline at end of file
252 // que se estan usando para el control
237 No newline at end of file
253
238 int puntero= atoi(puntero_char); // Se convierte a entero la direccion del puntero No newline at end of file
254 int puntero= atoi(puntero_char); // Se convierte a entero la direccion del puntero
239 No newline at end of file
255
240 int base= 7*puntero; // base= cantidad_bytes del dato x puntero No newline at end of file
256 int base= 7*puntero; // base= cantidad_bytes del dato x puntero
241 // cantidad de bytes es el numero de bytes que No newline at end of file
257 // cantidad de bytes es el numero de bytes que
242 printf("%i\n",puntero); // contiene cada dato, para este caso es 7 No newline at end of file
258 printf("%i\n",puntero); // contiene cada dato, para este caso es 7
243 // porque es 6 bits de datos + 1 bit del cambio No newline at end of file
259 // porque es 6 bits de datos + 1 bit del cambio
244 // de linea. No newline at end of file
260 // de linea.
245 char valor_char; No newline at end of file
261 char valor_char;
246 unsigned long valor; No newline at end of file
262 unsigned long valor;
247 unsigned long acumulado_ceros=0; No newline at end of file
263 unsigned long acumulado_ceros=0;
248 unsigned long acumulado_unos=0; No newline at end of file
264 unsigned long acumulado_unos=0;
249 No newline at end of file
265
250 int offset; // Defino offset para el desplazamiento a traves No newline at end of file
266 int offset; // Defino offset para el desplazamiento a traves
251 for(offset=0;offset<6;offset++){ // de cada dato que se obtiene del "buff_experimento" No newline at end of file
267 for(offset=0;offset<6;offset++){ // de cada dato que se obtiene del "buff_experimento"
252 No newline at end of file
268
253 valor_char= buff_experimento[base+offset]; // Obtengo el dato No newline at end of file
269 valor_char= buff_experimento[base+offset]; // Obtengo el dato
254 No newline at end of file
270
255 if (valor_char == '0'){ // Obtengo el número acumulado segun sea un cero o un uno No newline at end of file
271 if (valor_char == '0'){ // Obtengo el número acumulado segun sea un cero o un uno
256 valor= 0; No newline at end of file
272 valor= 0;
257 acumulado_ceros= acumulado_ceros + (1 << desplazamiento[offset]); No newline at end of file
273 acumulado_ceros= acumulado_ceros + (1 << desplazamiento[offset]);
258 }else{ No newline at end of file
274 }else{
259 valor= 1; No newline at end of file
275 valor= 1;
260 acumulado_unos= acumulado_unos + (1 << desplazamiento[offset]); No newline at end of file
276 acumulado_unos= acumulado_unos + (1 << desplazamiento[offset]);
261 } No newline at end of file
277 }
262 No newline at end of file
278
263 } No newline at end of file
279 }
264 No newline at end of file
280
265 pio_out(pioc, maskc_out, acumulado_unos, 1); No newline at end of file
281 pio_out(pioc, maskc_out, acumulado_unos, 1);
266 pio_out(pioc, maskc_out, acumulado_ceros, 0); No newline at end of file
282 pio_out(pioc, maskc_out, acumulado_ceros, 0);
267
283
No newline at end of file
284 //return 1; No newline at end of file
268 return 1; No newline at end of file
269 No newline at end of file
285
270 } No newline at end of file
286 }
271 No newline at end of file
287
272 /* No newline at end of file
288 /*
273 * Esta funcion lee "n" veces el estado del APUNTE actual y lo guarda en el No newline at end of file
289 * Esta funcion lee "n" veces el estado del APUNTE actual y lo guarda en el
274 * archivo Verificacion. No newline at end of file
290 * archivo Verificacion.
275 */ No newline at end of file
291 */
276
292
No newline at end of file
293 //int chequeo_sistema(char *numero_muestras){
277 int chequeo_sistema(char *numero_muestras){ No newline at end of file
No newline at end of file
294 void chequeo_sistema(char *numero_muestras){ No newline at end of file
278 No newline at end of file
295
279 char valor[7]; No newline at end of file
296 char valor[7];
280 int i,cnt; No newline at end of file
297 int i,cnt;
281 unsigned int entradac= 0; No newline at end of file
298 unsigned int entradac= 0;
282 FILE *fd; No newline at end of file
299 FILE *fd;
283 fd=fopen("/mnt/sd/archivos/Verificacion","w"); No newline at end of file
300 fd=fopen("/mnt/sd/archivos/Verificacion","w");
284 fprintf(fd,"%s\n","Verificacion"); No newline at end of file
301 fprintf(fd,"%s\n","Verificacion");
285 fprintf(fd,"%s\n","------------"); No newline at end of file
302 fprintf(fd,"%s\n","------------");
286 cnt=0; No newline at end of file
303 cnt=0;
287 do No newline at end of file
304 do
288 { No newline at end of file
305 {
289 //Inicializando arreglo No newline at end of file
306 //Inicializando arreglo
290 for(i=0;i<6;i++) No newline at end of file
307 for(i=0;i<6;i++)
291 valor[i]='0'; No newline at end of file
308 valor[i]='0';
292 No newline at end of file
309
293 valor[6]='\0'; No newline at end of file
310 valor[6]='\0';
294 No newline at end of file
311
295 //Lectura de puerto No newline at end of file
312 //Lectura de puerto
296 entradac= pio_in(piob,maskb_in); No newline at end of file
313 entradac= pio_in(piob,maskb_in);
297 No newline at end of file
314
298 //Dandole formato al dato No newline at end of file
315 //Dandole formato al dato
299 if (!(entradac & bit_up_2)) No newline at end of file
316 if (!(entradac & bit_up_2))
300 valor[0] = '1'; No newline at end of file
317 valor[0] = '1';
301 if (!(entradac & bit_up_1)) No newline at end of file
318 if (!(entradac & bit_up_1))
302 valor[1] = '1'; No newline at end of file
319 valor[1] = '1';
303 if (!(entradac & bit_up_0)) No newline at end of file
320 if (!(entradac & bit_up_0))
304 valor[2] = '1'; No newline at end of file
321 valor[2] = '1';
305 if (!(entradac & bit_dow_2)) No newline at end of file
322 if (!(entradac & bit_dow_2))
306 valor[3] = '1'; No newline at end of file
323 valor[3] = '1';
307 if (!(entradac & bit_dow_1)) No newline at end of file
324 if (!(entradac & bit_dow_1))
308 valor[4] = '1'; No newline at end of file
325 valor[4] = '1';
309 if (!(entradac & bit_dow_0)) No newline at end of file
326 if (!(entradac & bit_dow_0))
310 valor[5] = '1'; No newline at end of file
327 valor[5] = '1';
311 No newline at end of file
328
312 //Escribiendo en archivo No newline at end of file
329 //Escribiendo en archivo
313 fprintf(fd,"%s\n",valor); No newline at end of file
330 fprintf(fd,"%s\n",valor);
314 cnt=cnt+1; No newline at end of file
331 cnt=cnt+1;
315 usleep(1*1000*1000); No newline at end of file
332 usleep(1*1000*1000);
316
333
No newline at end of file
334 }while(cnt < (atoi(numero_muestras)+1)); No newline at end of file
317 }while(cnt < atoi(numero_muestras)); No newline at end of file
318 No newline at end of file
335
319 fclose(fd); No newline at end of file
336 fclose(fd);
320
337
No newline at end of file
338 //return 1;
321 return 1;
No newline at end of file
No newline at end of file
339 } No newline at end of file
322 } No newline at end of file
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now