2 * Copyright (c) 20126 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 #ifndef __ASP_SERVICE_H__
18 #define __ASP_SERVICE_H__
22 #include "asp-manager-util.h"
24 #define ASP_SERVICE_MACSTR_LEN 18
25 #define ASP_SERVICE_DEVICE_NAME_LEN 33
26 #define ASP_SERVICE_MACADDR_LEN 6
27 #define ASP_SERVICE_IPADDR_LEN 4
28 #define ASP_SERVICE_DEV_NAME_LEN 32
29 #define ASP_SERVICE_IFACE_NAME_LEN 16
30 #define ASP_SERVICE_ADV_ID_LEN 10
33 ASP_SERVICE_P2P_ROLE_NONE = 0x00, /**< Session network role none */
34 ASP_SERVICE_P2P_ROLE_NEW = 0x01, /**< Session network role new */
35 ASP_SERVICE_P2P_ROLE_CLIENT = 0x02, /**< Session network role client */
36 ASP_SERVICE_P2P_ROLE_GO = 0x04, /**< Session network role GO */
37 } asp_service_p2p_role_e;
40 ASP_SERVICE_ADV_STATUS_ADVERTISED,
41 ASP_SERVICE_ADV_STATUS_NOT_ADVERTISED,
42 } asp_service_advertise_status_e;
45 ASP_SERVICE_ADVERTISE_REASON_SUCCESS,
46 ASP_SERVICE_ADVERTISE_REASON_DUP,
47 ASP_SERVICE_ADVERTISE_REASON_OTHER,
48 } asp_service_advertise_reason_e;
51 ASP_SERVICE_STATUS_NOT_AVAILABLE = 0,
52 ASP_SERVICE_STATUS_AVAILABLE = 1,
53 } asp_service_status_e;
57 unsigned int search_id;
60 unsigned char preferred_connection;
64 unsigned int config_method;
68 GHashTable *service_info_map;
70 } asp_service_advertise_s;
74 unsigned int search_id;
77 unsigned char preferred_connection;
81 unsigned int config_method;
85 GHashTable *service_info_map;
89 int asp_service_init();
90 int asp_service_deinit();
91 int asp_service_advertise(asp_service_advertise_s *service, int replace);
92 int asp_service_cancel_advertise(asp_service_advertise_s *service);
93 int asp_service_seek(asp_service_seek_s *service, unsigned long long *search_id);
94 int asp_service_cancel_seek(asp_service_seek_s *service);
96 int asp_service_event_cb(void *event);
97 int asp_service_notify_advertise_status(unsigned int adv_id,
98 asp_service_advertise_status_e status,
99 asp_service_advertise_reason_e reason);
100 int asp_service_notify_search_result(unsigned int search_id,
101 const gchar *service_mac,
102 const gchar *service_device_name,
104 const gchar *service_type,
105 const gchar *instance_name,
106 GHashTable *service_info,
107 asp_service_status_e service_status);
109 #endif /* __ASP_SERVICE_H__ */