2 * Copyright (c) 2012, 2013 Samsung Electronics Co., Ltd.
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
8 * http://floralicense.org/license/
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.
16 #ifndef __NET_NFC_SERVER_PROCESS_PHDC_H__
17 #define __NET_NFC_SERVER_PROCESS_PHDC_H__
19 #include "net_nfc_gdbus.h"
20 #include "net_nfc_typedef_internal.h"
24 #define PHDC_SAN "urn:nfc:sn:phdc"
25 #define PHDS_SAN "urn:nfc:sn:phds"
26 #define PHDC_HEADER_LEN 2
30 NET_NFC_PHDC_OPERATION_FAILED = 0,
31 NET_NFC_PHDC_TARGET_CONNECTED ,
32 NET_NFC_PHDC_DATA_RECEIVED
33 }net_nfc_server_phdc_indication_type;
36 //callback for manager connection accept / agent connect
37 typedef void (*net_nfc_server_phdc_cb)(net_nfc_phdc_handle_h handle,
38 net_nfc_error_e result, net_nfc_server_phdc_indication_type indication, data_s *data);
40 //callback for data send
41 typedef gboolean (*net_nfc_server_phdc_send_cb)(net_nfc_phdc_handle_h handle,
42 net_nfc_error_e result, net_nfc_server_phdc_indication_type indication, gpointer *user_data);
44 typedef struct _net_nfc_server_phdc_context_t net_nfc_server_phdc_context_t;
46 struct _net_nfc_server_phdc_context_t
48 net_nfc_target_handle_s *handle;
49 net_nfc_error_e result;
50 net_nfc_llcp_socket_t socket;
53 net_nfc_server_phdc_cb cb;
58 net_nfc_error_e net_nfc_server_phdc_manager_start(net_nfc_target_handle_s *handle,
59 const char *san, sap_t sap, net_nfc_server_phdc_cb cb, void *user_param);
61 net_nfc_error_e net_nfc_server_phdc_agent_start(net_nfc_target_handle_s *handle,
62 const char *san, sap_t sap, net_nfc_server_phdc_cb cb, void *user_param);
64 net_nfc_error_e net_nfc_server_phdc_agent_request(net_nfc_phdc_handle_h handle,
65 data_s *data, net_nfc_server_phdc_send_cb cb, void *user_param);
68 #endif//__NET_NFC_SERVER_PROCESS_PHDC_H__