forked from eclipse-keyple/keyple-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed openLogicalChannel issue with OMAPI < 3
- Loading branch information
Showing
10 changed files
with
272 additions
and
325 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 0 additions & 24 deletions
24
...droid-omapi/src/main/java/org/eclipse/keyple/plugin/android/omapi/AndroidOmapiReader.java
This file was deleted.
Oops, something went wrong.
61 changes: 61 additions & 0 deletions
61
...android-omapi/src/main/java/org/eclipse/keyple/plugin/android/omapi/AndroidOmapiReader.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2019 Calypso Networks Association https://www.calypsonet-asso.org/ | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional information regarding copyright | ||
* ownership. | ||
* | ||
* This program and the accompanying materials are made available under the terms of the Eclipse | ||
* Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.eclipse.keyple.plugin.android.omapi | ||
|
||
import org.eclipse.keyple.core.seproxy.SeReader | ||
import org.eclipse.keyple.core.seproxy.plugin.local.AbstractLocalReader | ||
import org.eclipse.keyple.core.seproxy.plugin.local.SmartSelectionReader | ||
import org.eclipse.keyple.core.seproxy.protocol.SeCommonProtocols | ||
import org.eclipse.keyple.core.seproxy.protocol.SeProtocol | ||
import org.eclipse.keyple.core.seproxy.protocol.TransmissionMode | ||
import timber.log.Timber | ||
import java.util.HashMap | ||
|
||
/** | ||
* Communicates with Android readers throught the Open Mobile API see org.simalliance.openmobileapi.Reader | ||
* | ||
* Instances of this class represent SE readers supported by this device. These readers can be physical devices | ||
* or virtual devices. They can be removable or not. They can contain one SE that can or cannot be | ||
* removed. | ||
*/ | ||
abstract class AndroidOmapiReader(pluginName: String, readerName: String): AbstractLocalReader(pluginName, readerName), SmartSelectionReader{ | ||
|
||
private val parameters: MutableMap<String, String> = HashMap() | ||
|
||
override fun getParameters(): Map<String, String> { | ||
Timber.w("No parameters are supported by AndroidOmapiReaderImpl") | ||
return parameters | ||
} | ||
|
||
override fun setParameter(key: String, value: String) { | ||
Timber.w("No parameters are supported by AndroidOmapiReaderImpl") | ||
parameters[key] = value | ||
} | ||
|
||
/** | ||
* The transmission mode is always CONTACTS in an OMAPI reader | ||
* | ||
* @return the current transmission mode | ||
*/ | ||
override fun getTransmissionMode(): TransmissionMode { | ||
return TransmissionMode.CONTACTS | ||
} | ||
|
||
/** | ||
* Check that protocolFlag is PROTOCOL_ISO7816_3 | ||
* @param protocolFlag | ||
* @return true if match PROTOCOL_ISO7816_3 | ||
*/ | ||
override fun protocolFlagMatches(protocolFlag: SeProtocol?): Boolean { | ||
return protocolFlag == SeCommonProtocols.PROTOCOL_ISO7816_3 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.