Subversion Repositories heizung

Rev

Rev 7 | Rev 9 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7 Rev 8
Line 248... Line 248...
248
	   if (!serial_open())
248
	   if (!serial_open())
249
	      return NULL;
249
	      return NULL;
250
	}
250
	}
251
 
251
 
252
	pthread_mutex_lock (&fastmutex_ser);
252
	pthread_mutex_lock (&fastmutex_ser);
-
 
253
	sleep(1);	// Give the other thread time to initialize the structure
253
 
254
 
254
	while(1)
255
	while(1)
255
	{
256
	{
256
	   HEIZINDEX *act;
257
	   HEIZINDEX *act;
257
 
258
 
258
	   ActTemperature = GetTemp();
259
	   GetTemp();
259
	   sleep_sec = 300;
260
	   sleep_sec = 300;
260
 
261
 
261
	   // Compare the actual temperature with the one that should be
262
	   // Compare the actual temperature with the one that should be
262
	   // and switch heating on or off
263
	   // and switch heating on or off
263
	   if (HeizFirst)
264
	   if (HeizFirst)
Line 510... Line 511...
510
	{
511
	{
511
	   sprintf(&hv0[0], "PRESSURE:%.1f;", ActPressure);
512
	   sprintf(&hv0[0], "PRESSURE:%.1f;", ActPressure);
512
	   write(s1, &hv0[0], strlen(hv0));
513
	   write(s1, &hv0[0], strlen(hv0));
513
	}
514
	}
514
 
515
 
-
 
516
        if (!strcasecmp(bef, "HEATSTAT"))	// Return the status of the heating
-
 
517
        {
-
 
518
	   sprintf(&hv0[0], "HEATSTAT:%d;", HeatStatus);
-
 
519
	   write(s1, &hv0[0], strlen(hv0));
-
 
520
	}
-
 
521
 
515
	// SET DAY:<count>:<day>:<end1>:<temp>[:<end2>:<temp>[:...]];
522
	// SET DAY:<count>:<day>:<end1>:<temp>[:<end2>:<temp>[:...]];
516
	// <count>   number of entries following
523
	// <count>   number of entries following
517
	// <day>     The day of the week
524
	// <day>     The day of the week
518
	// <end1>    The end time
525
	// <end1>    The end time
519
	// <temp>    The temperature wanted until end time is reached
526
	// <temp>    The temperature wanted until end time is reached