2 * Copyright (c) 2012-2013 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 __NET_NFC_SERVER_PROCESS_PHDC_H__
18 #define __NET_NFC_SERVER_PROCESS_PHDC_H__
20 #include "net_nfc_gdbus.h"
21 #include "net_nfc_typedef_internal.h"
25 #define PHDC_SAN "urn:nfc:sn:phdc"
26 #define PHDS_SAN "urn:nfc:sn:phds"
27 #define PHDC_HEADER_LEN 2
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;
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);
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);
45 typedef struct _net_nfc_server_phdc_context_t net_nfc_server_phdc_context_t;
47 struct _net_nfc_server_phdc_context_t
49 net_nfc_target_handle_s *handle;
50 net_nfc_error_e result;
51 net_nfc_llcp_socket_t socket;
54 net_nfc_server_phdc_cb cb;
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);
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);
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);
69 #endif//__NET_NFC_SERVER_PROCESS_PHDC_H__