diff options
author | Jin Yoon <jinny.yoon@samsung.com> | 2017-07-03 20:15:14 +0900 |
---|---|---|
committer | Eunyoung Lee <ey928.lee@samsung.com> | 2017-07-04 14:56:21 +0900 |
commit | b0945fd222eef5d6054b75ec2b5a582969e3d272 (patch) | |
tree | 21af13e862fbc469525f5172706b835ce4aa8448 /inc | |
parent | 3a8ef8e79d03377fd15cb5fa8eb25b82e3c7ac86 (diff) | |
download | rcc-b0945fd222eef5d6054b75ec2b5a582969e3d272.tar.gz rcc-b0945fd222eef5d6054b75ec2b5a582969e3d272.tar.bz2 rcc-b0945fd222eef5d6054b75ec2b5a582969e3d272.zip |
MCC Pattern : Initial version
Change-Id: I6a839878b65784fd92b570056d09b61cb7d612fd
Diffstat (limited to 'inc')
-rw-r--r-- | inc/controller.h | 6 | ||||
-rw-r--r-- | inc/model.h | 17 | ||||
-rw-r--r-- | inc/model/model_infrared_motion_sensor.h | 8 | ||||
-rw-r--r-- | inc/model/model_infrared_obstacle_avoidance_sensor.h | 8 | ||||
-rw-r--r-- | inc/model/model_touch_sensor.h | 8 | ||||
-rw-r--r-- | inc/model/model_ultrasonic_sensor.h | 6 |
6 files changed, 23 insertions, 30 deletions
diff --git a/inc/controller.h b/inc/controller.h index aef6e47..7ecdc1d 100644 --- a/inc/controller.h +++ b/inc/controller.h @@ -19,10 +19,4 @@ #ifndef __POSITION_FINDER_CONTROLLER_H__ #define __POSITION_FINDER_CONTROLLER_H__ -typedef int (*controller_event_cb)(const char *event_name, void *event_info, void *data); - -extern int controller_register_event_cb(const char *event_name, controller_event_cb event_cb, void *data); -extern int controller_unregister_event_cb(const char *event_name, controller_event_cb event_cb); -extern int controller_send_event(const char *event_name, void *event_info); - #endif /* __POSITION_FINDER_CONTROLLER_H__ */ diff --git a/inc/model.h b/inc/model.h index 074dfe0..def3713 100644 --- a/inc/model.h +++ b/inc/model.h @@ -27,13 +27,18 @@ enum sensor_type { }; typedef enum sensor_type sensor_type_e; -extern int model_init(sensor_type_e sensor_type); -extern void model_fini(void); +typedef struct _model_sensor_s model_sensor_s; +typedef model_sensor_s *model_sensor_h; -extern int model_alloc(void **data); +extern int model_init(const char *id, sensor_type_e sensor_type, int gpio_num1, int gpio_num2, model_sensor_h *out_info); +extern void model_fini(model_sensor_h info); -extern int model_read_int_value(int *out_value); -extern int model_read_double_value(double *out_value); -extern int model_write(void *data); +extern int model_read_int_value(model_sensor_h info, int *out_value); +extern int model_read_double_value(model_sensor_h info, double *out_value); + +extern int model_list_add_sensor(model_sensor_h info); +extern int model_list_remove_sensor(model_sensor_h info); +extern int model_list_get_sensor(const char *id, model_sensor_h *out_info); +extern int model_list_foreach(void (*cb)(model_sensor_h info)); #endif /* __POSITION_FINDER_MODEL_H__ */ diff --git a/inc/model/model_infrared_motion_sensor.h b/inc/model/model_infrared_motion_sensor.h index 4ff90c7..6667a96 100644 --- a/inc/model/model_infrared_motion_sensor.h +++ b/inc/model/model_infrared_motion_sensor.h @@ -19,11 +19,9 @@ #ifndef __POSITION_FINDER_MODEL_INFRARED_MOTION_SENSOR_H__ #define __POSITION_FINDER_MODEL_INFRARED_MOTION_SENSOR_H__ -typedef struct infrared_motion_event infrared_motion_event_s; +extern int model_init_infrared_motion_sensor(int gpio_num, void **peripheral_info); +extern void model_fini_infrared_motion_sensor(void *peripheral_info); -extern int model_init_infrared_motion_sensor(void); -extern void model_fini_infrared_motion_sensor(void); - -extern int model_read_infrared_motion_sensor(int *out_value); +extern int model_read_infrared_motion_sensor(void *peripheral_info, int *out_value); #endif /* __POSITION_FINDER_MODEL_INFRARED_MOTION_SENSOR_H__ */ diff --git a/inc/model/model_infrared_obstacle_avoidance_sensor.h b/inc/model/model_infrared_obstacle_avoidance_sensor.h index bfba8f9..0833684 100644 --- a/inc/model/model_infrared_obstacle_avoidance_sensor.h +++ b/inc/model/model_infrared_obstacle_avoidance_sensor.h @@ -19,11 +19,9 @@ #ifndef __POSITION_FINDER_MODEL_INFRARED_OBSTACLE_AVOIDANCE_SENSOR_H__ #define __POSITION_FINDER_MODEL_INFRARED_OBSTACLE_AVOIDANCE_SENSOR_H__ -typedef struct infrared_obstacle_avoidance_event infrared_obstacle_avoidance_event_s; +extern int model_init_infrared_obstacle_avoidance_sensor(int gpio_num, void **peripheral_info); +extern void model_fini_infrared_obstacle_avoidance_sensor(void *peripheral_info); -extern int model_init_infrared_obstacle_avoidance_sensor(void); -extern void model_fini_infrared_obstacle_avoidance_sensor(void); - -extern int model_read_infrared_obstacle_avoidance_sensor(int *out_value); +extern int model_read_infrared_obstacle_avoidance_sensor(void *peripheral_info, int *out_value); #endif /* __POSITION_FINDER_MODEL_INFRARED_OBSTACLE_AVOIDANCE_SENSOR_H__ */ diff --git a/inc/model/model_touch_sensor.h b/inc/model/model_touch_sensor.h index 4be2525..263bf62 100644 --- a/inc/model/model_touch_sensor.h +++ b/inc/model/model_touch_sensor.h @@ -19,11 +19,9 @@ #ifndef __POSITION_FINDER_MODEL_TOUCH_SENSOR_H__ #define __POSITION_FINDER_MODEL_TOUCH_SENSOR_H__ -typedef struct touch_event touch_event_s; +extern int model_init_touch_sensor(int gpio_num, void **peripheral_info); +extern void model_fini_touch_sensor(void *peripheral_info); -extern int model_init_touch_sensor(void); -extern void model_fini_touch_sensor(void); - -extern int model_read_touch_sensor(int *out_value); +extern int model_read_touch_sensor(void *peripheral_info, int *out_value); #endif /* __POSITION_FINDER_MODEL_TOUCH_SENSOR_H__ */ diff --git a/inc/model/model_ultrasonic_sensor.h b/inc/model/model_ultrasonic_sensor.h index 93149af..d58737f 100644 --- a/inc/model/model_ultrasonic_sensor.h +++ b/inc/model/model_ultrasonic_sensor.h @@ -19,8 +19,8 @@ #ifndef __POSITION_FINDER_MODEL_ULTRASONIC_SENSOR_H__ #define __POSITION_FINDER_MODEL_ULTRASONIC_SENSOR_H__ -extern int model_init_ultrasonic_sensor(void); -extern void model_fini_ultrasonic_sensor(void); -extern int model_read_ultrasonic_sensor(double *value); +extern int model_init_ultrasonic_sensor(int gpio_num1, int gpio_num2, void **peripheral_info); +extern void model_fini_ultrasonic_sensor(void *peripheral_info); +extern int model_read_ultrasonic_sensor(void *peripheral_info, double *value); #endif /* __POSITION_FINDER_MODEL_ULTRASONIC_SENSOR_H__ */ |