2 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 /*****************************************************************************
19 *****************************************************************************/
26 /*****************************************************************************
28 *****************************************************************************/
33 /*****************************************************************************
34 * Application Service Platform manager headers
35 *****************************************************************************/
36 #include "asp-manager.h"
37 #include "asp-service.h"
38 #include "asp-session.h"
40 #include "asp-manager-util.h"
41 #include "asp-manager-gdbus.h"
43 /*****************************************************************************
45 *****************************************************************************/
47 /*****************************************************************************
49 *****************************************************************************/
51 /*****************************************************************************
52 * Local Functions Definition
53 *****************************************************************************/
55 void __asp_process_search_result(gpointer ctx, asp_event_data *data)
57 __ASP_LOG_FUNC_ENTER__;
60 ASP_LOGE("Invalid parameters");
64 asp_service_notify_search_result(
65 data->search_result.search_id,
66 data->search_result.service_mac,
67 data->search_result.device_name,
68 data->search_result.advertisement_id,
69 data->search_result.instance_name,
70 data->search_result.service_info,
71 data->search_result.service_status);
73 __ASP_LOG_FUNC_EXIT__;
77 void __asp_process_search_terminated(void *ctx, asp_event_data *data)
79 __ASP_LOG_FUNC_ENTER__;
81 __ASP_LOG_FUNC_EXIT__;
86 const gint32 event_id;
87 void (*function) (gpointer ctx, asp_event_data *data);
94 ASP_EVENT_SEARCH_RESULT,
95 __asp_process_search_result,
98 ASP_EVENT_SEARCH_TERMINATED,
99 __asp_process_search_terminated,
107 void asp_manager_event(gpointer ctx, asp_event_type_e event, asp_event_data *data)
109 __ASP_LOG_FUNC_ENTER__;
111 if (event > ASP_EVENT_NONE &&
112 event < ASP_EVENT_MAX)
113 asp_event_map[event].function(ctx, data);
115 ASP_LOGE("Invalid event");
117 __ASP_LOG_FUNC_EXIT__;