/*
-* 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.
-*/
-
+ * 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>
{
SCARD_DEBUG("there is no callback");
}
+
+ delete param;
}
else
{
{
SCARD_DEBUG("there is no callback");
}
+
+ delete param;
}
else
{
apdu_data.apdu = command.getBuffer();
apdu_data.apdu_len = command.getLength();
+ syncLock();
+
result = tel_req_sim_apdu(handle, &apdu_data, &UICCTerminal::uiccTransmitAPDUCallback, this);
if (result == 0)
{
error = 0;
this->response.releaseBuffer();
- syncLock();
result = waitTimedCondition(3);
- syncUnlock();
+
if (result == 0 && error == 0)
{
{
SCARD_DEBUG_ERR("tel_req_sim_apdu failed [%d]", result);
}
+
+ syncUnlock();
}
else
{
SCOPE_LOCK(mutex)
{
+ syncLock();
+
result = tel_req_sim_atr(handle, &UICCTerminal::uiccGetAtrCallback, this);
if (result == 0)
{
error = 0;
this->response.releaseBuffer();
- syncLock();
result = waitTimedCondition(3);
- syncUnlock();
if (result == 0 && error == 0)
{
{
SCARD_DEBUG_ERR("tel_req_sim_atr failed [%d]", result);
}
+
+ syncUnlock();
}
SCARD_END();
SCARD_DEBUG("APDU response");
+ instance->syncLock();
+
instance->error = access_rt;
if (instance->error == 0)
SCARD_DEBUG_ERR("error : event->Status == [%d]", access_rt);
}
- instance->syncLock();
instance->signalCondition();
instance->syncUnlock();
}
SCARD_DEBUG("Get ATR response");
+ instance->syncLock();
+
instance->error = access_rt;
if (access_rt == 0)
SCARD_DEBUG_ERR("error : event->Status == [%d]", access_rt);
}
- instance->syncLock();
instance->signalCondition();
instance->syncUnlock();
}
}
}
} /* namespace smartcard_service_api */
-