- /**
- * This is the case when a number of the same sensors are installed.
- * Each of the five infrared motion sensors will receive the value.
- */
- for (i = 0; i < MULTIPLE_SENSOR_NUMBER; i++) {
- /**
- * Infrared motion sensor outputs 1 if motion is detected, or 0 if motion is detected.
- */
- if (resource_read_infrared_motion_sensor(gpio_num[i], &value[i]) == -1) {
- _E("Failed to get Infrared Motion value [GPIO:%d]", gpio_num[i]);
- continue;
- }
- /**
- * If one of the five infrared motion sensors detects motion (1),
- * it is judged that there is a person (total == 1).
- */
- total |= value[i];
- }
- _I("[5:%d] | [6:%d] | [13:%d] | [19:%d] | [26:%d] = [Total:%d]", value[0], value[1], value[2], value[3], value[4], total);
-
- /**
- * Notifies specific clients that resource's attributes have changed.
- */
- if (connectivity_notify_bool(ad->resource_info, CONNECTIVITY_KEY, total) == -1)
+ /* This is example, get value from sensors first */
+ if (connectivity_notify_int(ad->resource_info, "Motion", value) == -1)