/*
- * libsensord
+ * sensord
*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
*
#ifndef _CLIENT_COMMON_H_
#define _CLIENT_COMMON_H_
-/*header for each sensor type*/
#include <sensor_internal.h>
#include <sensor_handle_info.h>
#include <reg_event_info.h>
-#include <sensor_logs.h>
+#include <sensor_log.h>
-#define BASE_GATHERING_INTERVAL 100
-
-#define CLIENT_NAME_SIZE NAME_MAX+10
-
-enum log_id {
- LOG_ID_START = 0,
- LOG_ID_SENSOR_TYPE = 0,
- LOG_ID_EVENT,
- LOG_ID_DATA,
- LOG_ID_PROPERTY,
- LOG_ID_END,
-};
-
-struct log_attr {
- const char *name;
- unsigned long cnt;
- const unsigned int print_per_cnt;
-};
-
-struct log_element {
- log_id id;
- unsigned int type;
- struct log_attr log_attr;
-};
+#include <memory>
+#define BASE_GATHERING_INTERVAL 100
+#define THREAD_TERMINATION -1
typedef struct {
+ unsigned long long event_id;
int handle;
+ sensor_t sensor;
unsigned int event_type;
- sensor_event_data_t ev_data;
- int sensor_state;
- int sensor_option;
- sensor_type_t sensor;
- reg_event_info event_info;
-} log_info;
+ sensor_cb_t cb;
+ std::shared_ptr<void> sensor_data;
+ void *user_data;
+ sensor_accuracy_changed_cb_t accuracy_cb;
+ unsigned long long timestamp;
+ int accuracy;
+ void *accuracy_user_data;
+} client_callback_info;
+
+const char *get_sensor_name(sensor_id_t sensor_id);
+const char *get_event_name(unsigned int event_type);
-bool is_one_shot_event(unsigned int event_type);
-bool is_ontime_event(unsigned int event_type);
-bool is_panning_event(unsigned int event_type);
-bool is_single_state_event(unsigned int event_type);
unsigned int get_calibration_event_type(unsigned int event_type);
-unsigned long long get_timestamp(void);
+unsigned int get_log_per_count(sensor_id_t id);
-const char* get_log_element_name(log_id id, unsigned int type);
-const char* get_sensor_name(sensor_id_t sensor_id);
-const char* get_event_name(unsigned int event_type);
-const char* get_data_name(unsigned int data_id);
-void print_event_occurrence_log(sensor_handle_info &sensor_handle_info, const reg_event_info *event_info);
+void print_event_occurrence_log(sensor_handle_info &sensor_handle_info);
class sensor_info;
sensor_info *sensor_to_sensor_info(sensor_t sensor);