revise cumbersome structure that is a opaque type
[platform/core/connectivity/nfc-manager-neard.git] / client / include / net_nfc_client_snep.h
1 /*
2  * Copyright (c) 2012, 2013 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Flora License, Version 1.1 (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
7  *
8  *     http://floralicense.org/license/
9  *
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.
15  */
16 #ifndef __NET_NFC_CLIENT_SNEP_H__
17 #define __NET_NFC_CLIENT_SNEP_H__
18
19 #include "net_nfc_typedef.h"
20
21 typedef void (*net_nfc_client_snep_event_cb)(
22                 net_nfc_snep_handle_h target,
23                 net_nfc_snep_type_t event,
24                 net_nfc_error_e result,
25                 ndef_message_s *msg,
26                 void *user_data);
27
28 net_nfc_error_e net_nfc_client_snep_start_server(
29                 net_nfc_target_handle_s *target,
30                 const char *san,
31                 sap_t sap,
32                 net_nfc_client_snep_event_cb callback,
33                 void *user_data);
34
35 net_nfc_error_e net_nfc_client_snep_start_client(
36                 net_nfc_target_handle_s *target,
37                 const char *san,
38                 sap_t sap,
39                 net_nfc_client_snep_event_cb callback,
40                 void *user_data);
41
42 net_nfc_error_e net_nfc_client_snep_send_client_request(
43                 net_nfc_snep_handle_h handle,
44                 net_nfc_snep_type_t snep_type,
45                 ndef_message_s *msg,
46                 net_nfc_client_snep_event_cb callback,
47                 void *user_data);
48
49 net_nfc_error_e net_nfc_client_snep_send_client_request_sync(
50                 net_nfc_target_handle_s *target,
51                 net_nfc_snep_type_t snep_type,
52                 ndef_message_s *msg,
53                 net_nfc_snep_type_t *resp_type,
54                 ndef_message_s **response);
55
56 net_nfc_error_e net_nfc_client_snep_stop_service(
57                 net_nfc_target_handle_s *target,
58                 net_nfc_snep_handle_h service,
59                 net_nfc_client_snep_event_cb callback,
60                 void *user_data);
61
62 net_nfc_error_e net_nfc_client_snep_stop_service_sync(
63                 net_nfc_target_handle_s *target, net_nfc_snep_handle_h service);
64
65 net_nfc_error_e net_nfc_client_snep_register_server(const char *san, sap_t sap,
66                 net_nfc_client_snep_event_cb callback, void *user_data);
67
68 net_nfc_error_e net_nfc_client_snep_unregister_server(const char *san,
69                 sap_t sap);
70
71 /* TODO : move to internal header */
72 net_nfc_error_e net_nfc_client_snep_init(void);
73
74 void net_nfc_client_snep_deinit(void);
75
76 #endif //__NET_NFC_CLIENT_SNEP_H__