thermferm/devices.c

changeset 657
38162f374842
parent 656
ca47c742a25d
child 658
b10d0f6337a3
--- a/thermferm/devices.c	Wed Apr 03 12:14:45 2024 +0200
+++ b/thermferm/devices.c	Wed Apr 03 16:21:46 2024 +0200
@@ -835,66 +835,6 @@
 			    free(addr);
 			    addr = NULL;
 			} /* if temperature sensor */
-			/*
-			 * DS2413 Dual channel addressable switch
-			 */
-			if (strncmp(device->address, (char *)"3a", 2) == 0) {
-			    addr = xstrcpy((char *)"/sys/bus/w1/devices/");
-			    addr = xstrcat(addr, device->address);
-			    addr = xstrcat(addr, (char *)"/state");
-
-			    if ((access(addr, R_OK)) == 0) {
-				if (device->present != DEVPRESENT_YES) {
-				    syslog(LOG_NOTICE, "DS2413 %s is back", device->address);
-				    pthread_mutex_lock(&mutexes[LOCK_DEVICES]);
-				    device->present = DEVPRESENT_YES;
-				    pthread_mutex_unlock(&mutexes[LOCK_DEVICES]);
-				}
-				/*
-				 * First make sure that if this device is configured as input
-				 * to drive the output high.
-				 */
-				if (device->direction == DEVDIR_IN_BIN) {
-				    uint8_t state, output;
-
-				    if ((rc = read_w1(device->address, (char *)"state")) >= 0) {
-					state = (unsigned int)rc;
-					output = ((state & 0x02) >> 1) + ((state & 0x08) >> 2);		/* Both latch states	*/
-					if (device->subdevice == 0) {
-					    output = (output & 0xfe);
-					    output |= 0x01;
-					} else if (device->subdevice == 1) {
-					    output = (output & 0xfd);
-					    output |= 0x02;
-					} else {
-					    output = 0xff;
-					}
-					write_w1(device->address, (char *)"output", output);
-				    }
-				}
-				if ((rc = read_w1(device->address, (char *)"state")) >= 0) {
-				    pthread_mutex_lock(&mutexes[LOCK_DEVICES]);
-				    /*
-				     * Read PIOA or PIOB pin state bits
-				     */
-				    if (device->subdevice == 0)
-					device->value = (rc & 0x01) ? 0 : 1;
-				    else if (device->subdevice == 1)
-					device->value = (rc & 0x04) ? 0 : 1;
-				    device->timestamp = time(NULL);
-				    pthread_mutex_unlock(&mutexes[LOCK_DEVICES]);
-				}
-			    } else {
-				if (device->present != DEVPRESENT_NO) {
-				    syslog(LOG_NOTICE, "DS2413 %s is missing", device->address);
-				    pthread_mutex_lock(&mutexes[LOCK_DEVICES]);
-				    device->present = DEVPRESENT_NO;
-				    pthread_mutex_unlock(&mutexes[LOCK_DEVICES]);
-				}
-			    }
-			    free(addr);
-			    addr = NULL;
-			}
 
 			break;
 

mercurial