Adjust comment
[platform/core/connectivity/smartcard-service.git] / client / Reader.cpp
index 12b0b9d..4382de9 100644 (file)
@@ -1,19 +1,18 @@
 /*
-* Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 /* standard library header */
 #include <stdio.h>
@@ -28,7 +27,6 @@
 #include "ClientIPC.h"
 #include "Reader.h"
 #include "Session.h"
-#include "SignatureHelper.h"
 
 #ifndef EXTERN_API
 #define EXTERN_API __attribute__((visibility("default")))
@@ -36,7 +34,7 @@
 
 namespace smartcard_service_api
 {
-       Reader::Reader(void *context, const char *name, void *handle):ReaderHelper()
+       Reader::Reader(void *context, const char *name, void *handle) : ReaderHelper()
        {
                unsigned int length = 0;
 
@@ -61,10 +59,6 @@ namespace smartcard_service_api
 
                present = true;
 
-#if 0
-               getPackageCert();
-#endif
-
                SCARD_END();
        }
 
@@ -83,6 +77,7 @@ namespace smartcard_service_api
        }
 
        void Reader::closeSessions()
+               throw(ErrorIO &, ErrorIllegalState &)
        {
                size_t i;
 
@@ -92,12 +87,8 @@ namespace smartcard_service_api
                }
        }
 
-       void Reader::getPackageCert()
-       {
-               packageCert = SignatureHelper::getCertificationHash(getpid());
-       }
-
        SessionHelper *Reader::openSessionSync()
+               throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &)
        {
                openedSession = NULL;
 
@@ -110,7 +101,6 @@ namespace smartcard_service_api
                        /* request channel handle from server */
                        msg.message = Message::MSG_REQUEST_OPEN_SESSION;
                        msg.param1 = (unsigned int)handle;
-                       msg.data = packageCert;
                        msg.error = (unsigned int)context; /* using error to context */
                        msg.caller = (void *)this;
                        msg.callback = (void *)this; /* if callback is class instance, it means synchronized call */
@@ -152,9 +142,6 @@ namespace smartcard_service_api
                        /* request channel handle from server */
                        msg.message = Message::MSG_REQUEST_OPEN_SESSION;
                        msg.param1 = (unsigned int)handle;
-#if 0
-                       msg.data = packageCert;
-#endif
                        msg.error = (unsigned int)context; /* using error to context */
                        msg.caller = (void *)this;
                        msg.callback = (void *)callback;
@@ -332,7 +319,4 @@ EXTERN_API void reader_close_sessions(reader_h handle)
 
 EXTERN_API void reader_destroy_instance(reader_h handle)
 {
-       READER_EXTERN_BEGIN;
-       delete reader;
-       READER_EXTERN_END;
 }