Skip to content

Commit 2f6bc0e

Browse files
Release 2.1.1
1 parent 824a9c8 commit 2f6bc0e

File tree

6 files changed

+34
-23
lines changed

6 files changed

+34
-23
lines changed

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
9+
## [2.1.1] - 2023-01-10
810
### Added
911
- `bluebird-plugin-mock` module containing an empty mock of the plugin.
1012
### Fixed
1113
- The identification of the protocol currently used to communicate with a card.
14+
### Removed
15+
- Definitions for unusable protocols (`MIFARE_CLASSIC`, `MIFARE_ULTRALIGHT`, `SRT512`).
1216
### CI
1317
- Automation of the right to execute (x) shell scripts.
1418
### Upgraded
15-
- "Keyple Util Library" to version `2.2.0` by removing the use of deprecated methods.
19+
- "Keyple Util Library" to version `2.3.0` by removing the use of deprecated methods.
1620

1721
## [2.1.0] - 2022-07-26
1822
### Added
@@ -36,7 +40,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3640
## [1.0.0] - 2020-12-18
3741
This is the initial release.
3842

39-
[unreleased]: https://github.com/calypsonet/keyple-plugin-cna-bluebird-specific-nfc-java-lib/compare/2.1.0...HEAD
43+
[unreleased]: https://github.com/calypsonet/keyple-plugin-cna-bluebird-specific-nfc-java-lib/compare/2.1.1...HEAD
44+
[2.1.1]: https://github.com/calypsonet/keyple-plugin-cna-bluebird-specific-nfc-java-lib/compare/2.1.0...2.1.1
4045
[2.1.0]: https://github.com/calypsonet/keyple-plugin-cna-bluebird-specific-nfc-java-lib/compare/2.0.0...2.1.0
4146
[2.0.0]: https://github.com/calypsonet/keyple-plugin-cna-bluebird-specific-nfc-java-lib/compare/1.0.0...2.0.0
4247
[1.0.0]: https://github.com/calypsonet/keyple-plugin-cna-bluebird-specific-nfc-java-lib/releases/tag/1.0.0

bluebird-plugin/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ dependencies {
9090
//keyple
9191
implementation("org.eclipse.keyple:keyple-common-java-api:2.0.0")
9292
implementation("org.eclipse.keyple:keyple-plugin-java-api:2.0.0")
93-
implementation("org.eclipse.keyple:keyple-util-java-lib:2.2.0")
93+
implementation("org.eclipse.keyple:keyple-util-java-lib:2.3.0")
9494

9595
//android
9696
implementation("androidx.legacy:legacy-support-v4:1.0.0")

bluebird-plugin/src/main/kotlin/org/calypsonet/keyple/plugin/bluebird/BluebirdContactlessReaderAdapter.kt

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ internal class BluebirdContactlessReaderAdapter(activity: Activity) :
109109
} catch (e: IllegalArgumentException) {
110110
return false
111111
}
112-
if ((protocol.value and pollingProtocols) != 0 ||
113-
(protocol == BluebirdSupportContactlessProtocols.ISO14443_4_SKY_ECP_A &&
114-
(pollingProtocols and BluebirdSupportContactlessProtocols.ISO_14443_4_A.value) != 0) ||
115-
(protocol == BluebirdSupportContactlessProtocols.ISO14443_4_SKY_ECP_B &&
116-
(pollingProtocols and BluebirdSupportContactlessProtocols.ISO_14443_4_B.value) != 0)) {
112+
if ((protocol == currentTag?.currentProtocol) ||
113+
(protocol == BluebirdSupportContactlessProtocols.ISO_14443_4_A_SKY_ECP &&
114+
currentTag?.currentProtocol == BluebirdSupportContactlessProtocols.ISO_14443_4_A) ||
115+
(protocol == BluebirdSupportContactlessProtocols.ISO_14443_4_B_SKY_ECP &&
116+
currentTag?.currentProtocol == BluebirdSupportContactlessProtocols.ISO_14443_4_B)) {
117117
return true
118118
}
119119
return false
@@ -147,8 +147,10 @@ internal class BluebirdContactlessReaderAdapter(activity: Activity) :
147147
BluebirdSupportContactlessProtocols.INNOVATRON_B_PRIME.name ->
148148
pollingProtocols =
149149
pollingProtocols or BluebirdSupportContactlessProtocols.INNOVATRON_B_PRIME.value
150-
BluebirdSupportContactlessProtocols.ISO14443_4_SKY_ECP_A.name -> {
150+
BluebirdSupportContactlessProtocols.ISO_14443_4_A_SKY_ECP.name -> {
151151
checkEcpAvailabilty()
152+
pollingProtocols =
153+
pollingProtocols or BluebirdSupportContactlessProtocols.ISO_14443_4_A.value
152154
if (vasupMode == ExtNfcReader.ECP.Mode.VASUP_B) {
153155
throw IllegalStateException("SKY ECP VASUP type B is set")
154156
}
@@ -158,8 +160,10 @@ internal class BluebirdContactlessReaderAdapter(activity: Activity) :
158160
}
159161
?: throw IllegalStateException("SKY ECP VASUP payload was not set")
160162
}
161-
BluebirdSupportContactlessProtocols.ISO14443_4_SKY_ECP_B.name -> {
163+
BluebirdSupportContactlessProtocols.ISO_14443_4_B_SKY_ECP.name -> {
162164
checkEcpAvailabilty()
165+
pollingProtocols =
166+
pollingProtocols or BluebirdSupportContactlessProtocols.ISO_14443_4_B.value
163167
if (vasupMode == ExtNfcReader.ECP.Mode.VASUP_A) {
164168
throw IllegalStateException("SKY ECP VASUP type A is set")
165169
}
@@ -189,8 +193,8 @@ internal class BluebirdContactlessReaderAdapter(activity: Activity) :
189193
BluebirdSupportContactlessProtocols.INNOVATRON_B_PRIME.name ->
190194
pollingProtocols =
191195
pollingProtocols xor BluebirdSupportContactlessProtocols.INNOVATRON_B_PRIME.value
192-
BluebirdSupportContactlessProtocols.ISO14443_4_SKY_ECP_A.name,
193-
BluebirdSupportContactlessProtocols.ISO14443_4_SKY_ECP_B.name -> {
196+
BluebirdSupportContactlessProtocols.ISO_14443_4_A_SKY_ECP.name,
197+
BluebirdSupportContactlessProtocols.ISO_14443_4_B_SKY_ECP.name -> {
194198
checkEcpAvailabilty()
195199
nfcEcp!!.clearConfiguration()
196200
vasupMode = null

bluebird-plugin/src/main/kotlin/org/calypsonet/keyple/plugin/bluebird/BluebirdSupportContactlessProtocols.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,10 @@ package org.calypsonet.keyple.plugin.bluebird
2020
*/
2121
enum class BluebirdSupportContactlessProtocols constructor(val value: Int) {
2222
ISO_14443_4_A(0x01),
23+
ISO_14443_4_A_SKY_ECP(0x81),
2324
ISO_14443_4_B(0x02),
24-
INNOVATRON_B_PRIME(0x04),
25-
SRT512(0x08),
26-
MIFARE_CLASSIC(0x10),
27-
MIFARE_ULTRALIGHT(0x20),
28-
ISO14443_4_SKY_ECP_A(0x81),
29-
ISO14443_4_SKY_ECP_B(0x82);
25+
ISO_14443_4_B_SKY_ECP(0x82),
26+
INNOVATRON_B_PRIME(0x04);
3027

3128
companion object {
3229
fun fromValue(value: Int): BluebirdSupportContactlessProtocols {

example-app/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ dependencies {
6767
//Keyple Common
6868
implementation(project(path = ":bluebird-plugin"))
6969

70-
implementation("org.calypsonet.terminal:calypsonet-terminal-reader-java-api:1.0.+") { isChanging = true }
70+
implementation("org.calypsonet.terminal:calypsonet-terminal-reader-java-api:1.2.+") { isChanging = true }
7171
implementation("org.calypsonet.terminal:calypsonet-terminal-calypso-java-api:1.2.+") { isChanging = true }
7272
implementation("org.eclipse.keyple:keyple-common-java-api:2.0.+") { isChanging = true }
73-
implementation("org.eclipse.keyple:keyple-service-java-lib:2.1.0")
73+
implementation("org.eclipse.keyple:keyple-service-java-lib:2.1.2")
7474
implementation("org.eclipse.keyple:keyple-service-resource-java-lib:2.0.2")
75-
implementation("org.eclipse.keyple:keyple-card-calypso-java-lib:2.2.1")
75+
implementation("org.eclipse.keyple:keyple-card-calypso-java-lib:2.3.1")
7676
implementation("org.eclipse.keyple:keyple-util-java-lib:2.+") { isChanging = true }
7777

7878
/*

example-app/src/main/kotlin/org/calypsonet/keyple/plugin/bluebird/example/activity/MainActivity.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,13 @@ class MainActivity : AbstractExampleActivity() {
131131

132132
// Activate protocols for the card reader: B, B' and SKY ECP B
133133
cardReader.activateProtocol(
134-
BluebirdSupportContactlessProtocols.ISO_14443_4_B.name, "ISO_14443_4_CARD")
134+
BluebirdSupportContactlessProtocols.ISO_14443_4_A.name, "ISO_14443_4_A_CARD")
135+
cardReader.activateProtocol(
136+
BluebirdSupportContactlessProtocols.ISO_14443_4_B.name, "ISO_14443_4_B_CARD")
135137
cardReader.activateProtocol(
136138
BluebirdSupportContactlessProtocols.INNOVATRON_B_PRIME.name, "INNOVATRON_B_PRIME_CARD")
137139
cardReader.activateProtocol(
138-
BluebirdSupportContactlessProtocols.ISO14443_4_SKY_ECP_B.name, "ISO_14443_4_CARD")
140+
BluebirdSupportContactlessProtocols.ISO_14443_4_B_SKY_ECP.name, "ISO_14443_4_CARD")
139141

140142
// Get and configure the SAM reader
141143
samReader = bluebirdPlugin.getReader(BluebirdContactReader.READER_NAME)
@@ -267,11 +269,13 @@ class MainActivity : AbstractExampleActivity() {
267269
CoroutineScope(Dispatchers.Main).launch {
268270
when (event?.type) {
269271
CardReaderEvent.Type.CARD_MATCHED -> {
272+
addResultEvent("Protocol: ${cardReader.currentProtocol}")
270273
addResultEvent("Card detected with AID: ${CalypsoClassicInfo.AID}")
271274
responseProcessor(event.scheduledCardSelectionsResponse)
272275
(cardReader as ObservableCardReader).finalizeCardProcessing()
273276
}
274277
CardReaderEvent.Type.CARD_INSERTED -> {
278+
addResultEvent("Protocol: ${cardReader.currentProtocol}")
275279
addResultEvent(
276280
"Card detected but AID didn't match with ${CalypsoClassicInfo.AID}")
277281
(cardReader as ObservableCardReader).finalizeCardProcessing()
@@ -534,6 +538,7 @@ class MainActivity : AbstractExampleActivity() {
534538
permissions: Array<out String>,
535539
grantResults: IntArray
536540
) {
541+
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
537542
when (requestCode) {
538543
PermissionHelper.MY_PERMISSIONS_REQUEST_ALL -> {
539544
val storagePermissionGranted =

0 commit comments

Comments
 (0)