thermferm/devices.c

changeset 163
3d813570a5e3
parent 162
6fc9e3f7962f
child 164
f16def8472ba
equal deleted inserted replaced
162:6fc9e3f7962f 163:3d813570a5e3
148 uuid_generate(uu); 148 uuid_generate(uu);
149 uuid_unparse(uu, ndev->uuid); 149 uuid_unparse(uu, ndev->uuid);
150 ndev->type = DEVTYPE_GPIO; 150 ndev->type = DEVTYPE_GPIO;
151 ndev->value = digitalRead(pin); 151 ndev->value = digitalRead(pin);
152 ndev->present = DEVPRESENT_YES; 152 ndev->present = DEVPRESENT_YES;
153 snprintf(buf, 39, "GPIO%d", i); 153 ndev->address = xstrcpy((char *)"GPIO");
154 ndev->address = xstrcpy(buf);
155 snprintf(buf, 39, "Raspberry GPIO %d", i); 154 snprintf(buf, 39, "Raspberry GPIO %d", i);
156 ndev->description = xstrcpy(buf); 155 ndev->description = xstrcpy(buf);
157 ndev->subdevice = i; 156 ndev->subdevice = i;
158 ndev->gpiopin = pin; 157 ndev->gpiopin = pin;
159 ndev->timestamp = time(NULL); 158 ndev->timestamp = time(NULL);

mercurial