Remove unnecessary setting
[platform/core/connectivity/nfc-manager-neard.git] / daemon / net_nfc_server_process_phdc.h
1 /*
2  * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  *                               http://www.apache.org/licenses/LICENSE-2.0
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
17 #ifndef __NET_NFC_SERVER_PROCESS_PHDC_H__
18 #define __NET_NFC_SERVER_PROCESS_PHDC_H__
19
20 #include "net_nfc_gdbus.h"
21 #include "net_nfc_typedef_internal.h"
22
23 #define PHDC_SAP 0x16
24 #define PHDS_SAP 0x17
25 #define PHDC_SAN "urn:nfc:sn:phdc"
26 #define PHDS_SAN "urn:nfc:sn:phds"
27 #define PHDC_HEADER_LEN 2
28
29 typedef enum
30 {
31         NET_NFC_PHDC_OPERATION_FAILED = 0,
32         NET_NFC_PHDC_TARGET_CONNECTED ,
33         NET_NFC_PHDC_DATA_RECEIVED
34 }net_nfc_server_phdc_indication_type;
35
36
37 //callback for manager connection accept / agent connect
38 typedef void (*net_nfc_server_phdc_cb)(net_nfc_phdc_handle_h handle,
39                 net_nfc_error_e result, net_nfc_server_phdc_indication_type indication, data_s *data);
40
41 //callback for data send
42 typedef gboolean (*net_nfc_server_phdc_send_cb)(net_nfc_phdc_handle_h handle,
43                 net_nfc_error_e result, net_nfc_server_phdc_indication_type indication, gpointer *user_data);
44
45 typedef struct _net_nfc_server_phdc_context_t net_nfc_server_phdc_context_t;
46
47 struct _net_nfc_server_phdc_context_t
48 {
49         net_nfc_target_handle_s *handle;
50         net_nfc_error_e result;
51         net_nfc_llcp_socket_t socket;
52         uint32_t state;
53         data_s data;
54         net_nfc_server_phdc_cb cb;
55         void *user_param;
56         GQueue queue;
57 };
58
59 net_nfc_error_e net_nfc_server_phdc_manager_start(net_nfc_target_handle_s *handle,
60                 const char *san, sap_t sap, net_nfc_server_phdc_cb cb,  void *user_param);
61
62 net_nfc_error_e net_nfc_server_phdc_agent_start(net_nfc_target_handle_s *handle,
63                 const char *san, sap_t sap, net_nfc_server_phdc_cb cb, void *user_param);
64
65 net_nfc_error_e net_nfc_server_phdc_agent_request(net_nfc_phdc_handle_h handle,
66                 data_s *data, net_nfc_server_phdc_send_cb cb, void *user_param);
67
68
69 #endif//__NET_NFC_SERVER_PROCESS_PHDC_H__
70