add web notification feature, but not enabled yet
[apps/native/position-finder-server.git] / src / controller.c
old mode 100644 (file)
new mode 100755 (executable)
index 20388a7..da4b439
@@ -5,6 +5,7 @@
  *          Geunsun Lee <gs86.lee@samsung.com>
  *          Eunyoung Lee <ey928.lee@samsung.com>
  *          Junkyu Han <junkyu.han@samsung.com>
+ *          Jeonghoon Park <jh1979.park@samsung.com>
  *
  * Licensed under the Flora License, Version 1.1 (the License);
  * you may not use this file except in compliance with the License.
 #include "connectivity.h"
 #include "controller.h"
 
+#ifdef ENABLE_WEBNOTIFY
+#include "webnotify.h"
+#ifndef RESOURCE_URI
+#define RESOURCE_URI TEST_RES_URI
+#endif /* RESOURCE_URI */
+#endif /* ENABLE_WEBNOTIFY */
+
 #define GPIO_ULTRASONIC_TRIG_NUM_1 20
 #define GPIO_ULTRASONIC_ECHO_NUM_1 21
 #define MULTIPLE_SENSOR_NUMBER 5
@@ -62,6 +70,11 @@ static Eina_Bool control_read_sensors_cb(void *data)
        if (connectivity_notify_bool(ad->resource_info, CONNECTIVITY_KEY, total) == -1)
                _E("Cannot notify message");
 
+#ifdef ENABLE_WEBNOTIFY
+       if (web_notify_bool(RESOURCE_URI, total) == -1)
+               _E("Cannot notify web message");
+#endif /* ENABLE_WEBNOTIFY */
+
        return ECORE_CALLBACK_RENEW;
 }