thermferm/server.c

changeset 698
92a080c1a5d5
parent 696
fe042f9484ac
child 699
35382668a140
equal deleted inserted replaced
697:685f20ad87ed 698:92a080c1a5d5
707 707
708 if (strcmp(opt, (char *)"GET") == 0) { 708 if (strcmp(opt, (char *)"GET") == 0) {
709 srv_send(s, (char *)"213 Global Settings record follows:"); 709 srv_send(s, (char *)"213 Global Settings record follows:");
710 srv_send(s, (char *)"RELEASE,%s", VERSION); 710 srv_send(s, (char *)"RELEASE,%s", VERSION);
711 srv_send(s, (char *)"NAME,%s", Config.name); 711 srv_send(s, (char *)"NAME,%s", Config.name);
712 srv_send(s, (char *)"UUID,%s", Config.uuid);
712 srv_send(s, (char *)"PORT,%d", Config.server_port); 713 srv_send(s, (char *)"PORT,%d", Config.server_port);
713 srv_send(s, (char *)"TEMP_UUID,%s", Config.temp_uuid); 714 srv_send(s, (char *)"TEMP_UUID,%s", Config.temp_uuid);
714 srv_send(s, (char *)"TEMP_STATE,%s", DEVPRESENT[Config.temp_state]); 715 srv_send(s, (char *)"TEMP_STATE,%s", DEVPRESENT[Config.temp_state]);
715 srv_send(s, (char *)"TEMP_VALUE,%.1f", Config.temp_value / 1000.0); 716 srv_send(s, (char *)"TEMP_VALUE,%.1f", Config.temp_value / 1000.0);
716 srv_send(s, (char *)"HUM_UUID,%s", Config.hum_uuid); 717 srv_send(s, (char *)"HUM_UUID,%s", Config.hum_uuid);
805 if (sscanf(val, "%d", &ival) == 1) { 806 if (sscanf(val, "%d", &ival) == 1) {
806 if (Config.temp_hum_idx != ival) 807 if (Config.temp_hum_idx != ival)
807 syslog(LOG_NOTICE, "Global Temp/Humidity idx %d to %d", Config.temp_hum_idx, ival); 808 syslog(LOG_NOTICE, "Global Temp/Humidity idx %d to %d", Config.temp_hum_idx, ival);
808 Config.temp_hum_idx = ival; 809 Config.temp_hum_idx = ival;
809 } 810 }
811
812 } else if (val && (strcmp(kwd, (char *)"LCD_ADDRESS") == 0)) {
813 if (sscanf(val, "%d", &ival) == 1) {
814 if (Config.lcd_address != ival)
815 syslog(LOG_NOTICE, "Global LCD address %d to %d", Config.lcd_address, ival);
816 Config.lcd_address = ival;
817 }
810 818
811 } else if (val && (strcmp(kwd, (char *)"LCD_COLS") == 0)) { 819 } else if (val && (strcmp(kwd, (char *)"LCD_COLS") == 0)) {
812 if (sscanf(val, "%d", &ival) == 1) { 820 if (sscanf(val, "%d", &ival) == 1) {
813 if (Config.lcd_cols != ival) 821 if (Config.lcd_cols != ival)
814 syslog(LOG_NOTICE, "Global LCD columns %d to %d", Config.lcd_cols, ival); 822 syslog(LOG_NOTICE, "Global LCD columns %d to %d", Config.lcd_cols, ival);

mercurial