2 * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
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.
18 #ifndef CLIENTCHANNEL_H_
19 #define CLIENTCHANNEL_H_
21 /* standard library header */
23 /* SLP library header */
26 #include "smartcard-types.h"
30 #endif /* __cplusplus */
33 namespace smartcard_service_api
35 class ClientChannel: public Channel
40 /* temporary data for sync function */
44 ClientChannel(void *context, Session *session, int channelNum, ByteArray selectResponse, void *handle);
46 static bool dispatcherCallback(void *message);
49 int transmitSync(ByteArray command, ByteArray &result);
54 int close(closeCallback callback, void *userParam);
55 int transmit(ByteArray command, transmitCallback callback, void *userParam);
57 friend class ClientDispatcher;
61 } /* namespace smartcard_service_api */
62 #endif /* __cplusplus */
68 #endif /* __cplusplus */
70 int channel_close(channel_h handle, channel_close_cb callback, void *userParam);
71 int channel_transmit(channel_h handle, unsigned char *command, unsigned int length, channel_transmit_cb callback, void *userParam);
72 bool channel_is_basic_channel(channel_h handle);
73 bool channel_is_closed(channel_h handle);
75 unsigned int channel_get_select_response_length(channel_h handle);
76 bool channel_get_select_response(channel_h handle, unsigned char *buffer, unsigned int length);
77 session_h channel_get_session(channel_h handle);
78 void channel_destroy_instance(channel_h handle);
82 #endif /* __cplusplus */
84 #endif /* CLIENTCHANNEL_H_ */