Apply the initial codes for BT emulator
[platform/core/connectivity/bluetooth-frwk.git] / bt-service-emul / bt-service-obex-server.c
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
18 #include <stdio.h>
19 #include <glib.h>
20 #include <string.h>
21
22
23 #include "bluetooth-api.h"
24 #include "bt-internal-types.h"
25
26 #include "bt-service-common.h"
27 #include "bt-service-event.h"
28 #include "bt-service-util.h"
29 #include "bt-service-obex-server.h"
30
31 typedef struct {
32         GDBusMethodInvocation *reply_context;
33         guint64 file_size;
34         char *filename;
35         char *file_path;
36         char *device_name;
37         char *transfer_path;
38         char *address;
39 } bt_auth_info_t;
40
41 typedef struct {
42         char *dest_path;
43         char *sender;
44         int app_pid;
45 } bt_server_info_t;
46
47 typedef struct {
48         GDBusProxy *proxy;
49         int server_type;
50         int accept_id;
51         bt_auth_info_t *auth_info;
52         bt_server_info_t *native_server;
53         bt_server_info_t *custom_server;
54 } bt_obex_agent_info_t;
55
56 static bt_obex_agent_info_t agent_info;
57
58 int _bt_obex_server_allocate(char *sender, const char *dest_path, int app_pid, gboolean is_native)
59 {
60         return BLUETOOTH_ERROR_NOT_SUPPORT;
61 }
62
63 int _bt_obex_server_deallocate(int app_pid, gboolean is_native)
64 {
65         return BLUETOOTH_ERROR_NOT_SUPPORT;
66 }
67
68 int _bt_obex_server_accept_authorize(const char *filename, gboolean is_native)
69 {
70         BT_CHECK_PARAMETER(filename, return);
71
72         return BLUETOOTH_ERROR_NOT_SUPPORT;
73 }
74
75 int _bt_obex_server_reject_authorize(void)
76 {
77         return BLUETOOTH_ERROR_NOT_SUPPORT;
78 }
79
80 int _bt_obex_server_set_destination_path(const char *dest_path,
81                                                 gboolean is_native)
82 {
83         BT_CHECK_PARAMETER(dest_path, return);
84
85         return BLUETOOTH_ERROR_NOT_SUPPORT;
86 }
87
88 int _bt_obex_server_set_root(const char *root)
89 {
90         BT_CHECK_PARAMETER(root, return);
91
92         return BLUETOOTH_ERROR_NOT_SUPPORT;
93 }
94
95 int _bt_obex_server_cancel_transfer(int transfer_id)
96 {
97         return BLUETOOTH_ERROR_NOT_SUPPORT;
98 }
99
100 int _bt_obex_server_cancel_all_transfers(void)
101 {
102         return BLUETOOTH_ERROR_NOT_SUPPORT;
103 }
104
105 int _bt_obex_server_is_activated(gboolean *activated)
106 {
107         BT_CHECK_PARAMETER(activated, return);
108
109         return BLUETOOTH_ERROR_NOT_SUPPORT;
110 }
111
112 /* To support the BOT  */
113 int _bt_obex_server_accept_connection(int request_id)
114 {
115         return BLUETOOTH_ERROR_NOT_SUPPORT;
116 }
117
118 /* To support the BOT  */
119 int _bt_obex_server_reject_connection(void)
120 {
121         return BLUETOOTH_ERROR_NOT_SUPPORT;
122 }
123
124 int _bt_obex_server_is_receiving(gboolean *receiving)
125 {
126         BT_CHECK_PARAMETER(receiving, return);
127
128         return BLUETOOTH_ERROR_NOT_SUPPORT;
129 }
130
131 int _bt_obex_get_native_pid(void)
132 {
133         return agent_info.native_server->app_pid;
134 }
135