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 SERVERGDBUS_H_
18 #define SERVERGDBUS_H_
24 #include "Synchronous.h"
25 #include "GDBusHelper.h"
26 #include "smartcard-service-gdbus.h"
30 namespace smartcard_service_api
32 typedef void (*dispatcher_cb_t)(vector<void *> ¶ms);
34 class GDBusDispatcher : public Synchronous
37 static GDBusDispatcher &getInstance();
40 static void push(dispatcher_cb_t cb, const vector<void *> ¶ms);
43 std::queue<pair<dispatcher_cb_t, vector<void *> > > q;
48 void _push(dispatcher_cb_t cb, const vector<void *> ¶ms);
49 static gboolean dispatch(gpointer user_data);
55 GDBusProxy *dbus_proxy;
57 static ServerGDBus &getInstance();
62 /* connect to dbus daemon */
65 pid_t getPID(const char *name);
67 void emitReaderInserted(unsigned int reader_id,
68 const char *reader_name);
69 void emitReaderRemoved(unsigned int reader_id,
70 const char *reader_name);
73 GDBusConnection *connection;
75 SmartcardServiceSeService *seService;
76 SmartcardServiceReader *reader;
77 SmartcardServiceSession *session;
78 SmartcardServiceChannel *channel;
84 void deinitSEService();
95 } /* namespace smartcard_service_api */
97 #endif /* SERVERGDBUS_H_ */