diff options
author | Jin Yoon <jinny.yoon@samsung.com> | 2017-07-24 11:43:09 +0900 |
---|---|---|
committer | Jin Yoon <jinny.yoon@samsung.com> | 2017-07-24 11:45:26 +0900 |
commit | ecedf91d68b97b5876ac75e5bfa3365dd8e70e1e (patch) | |
tree | d116ff78bfe18000f6eb5619baa36db3597645a6 /src | |
parent | 5782ff3c7f400a0dba54c8fa2ac857d5d768674f (diff) | |
download | rcc-ecedf91d68b97b5876ac75e5bfa3365dd8e70e1e.tar.gz rcc-ecedf91d68b97b5876ac75e5bfa3365dd8e70e1e.tar.bz2 rcc-ecedf91d68b97b5876ac75e5bfa3365dd8e70e1e.zip |
Encapsulate pre-defined functions into controller_internal.c
Change-Id: I5801569003f9331fd8e7a7bd4fb9c96e237ae9f0
Diffstat (limited to 'src')
-rw-r--r-- | src/controller.c | 20 | ||||
-rw-r--r-- | src/controller_internal.c | 38 |
2 files changed, 40 insertions, 18 deletions
diff --git a/src/controller.c b/src/controller.c index cee20d9..06cb7b7 100644 --- a/src/controller.c +++ b/src/controller.c @@ -42,9 +42,6 @@ #define USE_MULTIPLE_SENSOR 0 #define MULTIPLE_SENSOR_NUMBER 5 -static void _start_internal_function(void); -static void _stop_internal_function(void); - typedef struct app_data_s { Ecore_Timer *getter_timer[PIN_MAX]; connectivity_resource_s *resource_info; @@ -111,7 +108,7 @@ static bool service_app_create(void *data) app_data *ad = data; int ret = -1; - _start_internal_function(); + controller_init_internal_functions(); ret = connectivity_set_resource("/door/1", "org.tizen.door", &ad->resource_info); if (ret == -1) _E("Cannot broadcast resource"); @@ -159,7 +156,7 @@ static void service_app_terminate(void *data) } connectivity_unset_resource(ad->resource_info); - _stop_internal_function(); + controller_fini_internal_functions(); free(ad); } @@ -211,16 +208,3 @@ int main(int argc, char* argv[]) return ret; } - -/* Do not modify codes under this comment */ -static void _start_internal_function(void) -{ - connectivity_init(); -} - -static void _stop_internal_function(void) -{ - _I("Terminating..."); - resource_close_all(); - connectivity_fini(); -} diff --git a/src/controller_internal.c b/src/controller_internal.c new file mode 100644 index 0000000..9deb732 --- /dev/null +++ b/src/controller_internal.c @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved + * + * Contact: Jin Yoon <jinny.yoon@samsung.com> + * Geunsun Lee <gs86.lee@samsung.com> + * Eunyoung Lee <ey928.lee@samsung.com> + * Junkyu Han <junkyu.han@samsung.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include <iotcon.h> + +#include "log.h" +#include "connectivity.h" +#include "resource.h" + +void controller_init_internal_functions(void) +{ + connectivity_init(); +} + +void controller_fini_internal_functions(void) +{ + _I("Terminating..."); + resource_close_all(); + connectivity_fini(); +} |