#include "webutil.h"
#define CONNECTIVITY_KEY "opened"
-#define SENSORING_TIME_INTERVAL 1.0f
+#define SENSORING_TIME_INTERVAL 0.01f
typedef struct app_data_s {
Ecore_Timer *getter_timer;
connectivity_resource_s *resource_info;
} app_data;
+const char bar[][128] = {
+ ")",
+ "))",
+ ")))",
+ "))))",
+ ")))))",
+ "))))))",
+ ")))))))",
+ "))))))))",
+ ")))))))))",
+ "))))))))))",
+ ")))))))))))",
+ "))))))))))))",
+ ")))))))))))))",
+ "))))))))))))))",
+ ")))))))))))))))",
+ "))))))))))))))))",
+ ")))))))))))))))))",
+ "))))))))))))))))))",
+ ")))))))))))))))))))",
+ "))))))))))))))))))))",
+ ")))))))))))))))))))))",
+ "))))))))))))))))))))))",
+ ")))))))))))))))))))))))",
+ "))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))",
+ "))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))"
+};
+
static Eina_Bool control_sensors_cb(void *data)
{
- app_data *ad = data;
+ unsigned int sl_value = 0;
+ unsigned int index = 0;
+
+ if (resource_read_sound_level_sensor(0, &sl_value) == -1)
+ _E("failed to resource_read_sound_level_sensor()");
- if (connectivity_notify_bool(ad->resource_info, CONNECTIVITY_KEY, true) == -1)
- _E("Cannot notify message");
+ index = sl_value/8;
+ _D("value : %4u %s", sl_value, bar[index]);
return ECORE_CALLBACK_RENEW;
}
controller_init_internal_functions();
/**
- * Create a connectivity resource and registers the resource in server.
- */
- ret = connectivity_set_resource(NULL, "org.tizen.door", &ad->resource_info);
- if (ret == -1) _E("Cannot broadcast resource");
-
- /**
* Creates a timer to call the given function in the given period of time.
* In the control_sensors_cb(), each sensor reads the measured value or writes a specific value to the sensor.
*/
if (ad->getter_timer)
ecore_timer_del(ad->getter_timer);
-
- /**
- * Releases the resource about connectivity.
- */
- connectivity_unset_resource(ad->resource_info);
-
/**
* No modification required!!!
* Access only when modifying internal functions.