Add NOTICE, AUTHOR file and modify boilerplate
[platform/core/connectivity/smartcard-service.git] / server / ServiceInstance.cpp
index 618b17e..3643311 100644 (file)
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+* Copyright (c) 2012, 2013 Samsung Electronics Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 
 namespace smartcard_service_api
 {
-       unsigned int ServiceInstance::openSession(Terminal *terminal, ByteArray packageCert, void *caller)
+       unsigned int ServiceInstance::openSession(Terminal *terminal, vector<ByteArray> &certHashes, void *caller)
        {
                unsigned int handle = IntegerHandle::assignHandle();
 
-               ServerSession *session = new ServerSession((ServerReader *)0, packageCert, caller, terminal);
+               ServerSession *session = new ServerSession((ServerReader *)0, certHashes, caller, terminal);
 
                mapSessions.insert(make_pair(handle, make_pair(session, terminal)));
 
@@ -97,7 +97,7 @@ namespace smartcard_service_api
                mapSessions.clear();
        }
 
-       unsigned int ServiceInstance::openChannel(unsigned int session, int channelNum)
+       unsigned int ServiceInstance::openChannel(unsigned int session, int channelNum, ByteArray response)
        {
                Terminal *terminal = getTerminal(session);
                ServerChannel *channel = NULL;
@@ -109,6 +109,9 @@ namespace smartcard_service_api
                {
                        handle = IntegerHandle::assignHandle();
                        mapChannels.insert(make_pair(handle, make_pair(session, channel)));
+
+                       if (response != ByteArray::EMPTY)
+                               channel->selectResponse = response;
                }
                else
                {