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); |