summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/uic/barcode/Encoder.java
diff options
context:
space:
mode:
authorCGantert345 <57003061+CGantert345@users.noreply.github.com>2021-11-25 16:39:28 +0100
committerGitHub <noreply@github.com>2021-11-25 16:39:28 +0100
commitc9f27f2de9b3fa713d10cb2f8014aad4e8af3070 (patch)
treeca00d8bae19bfcb5d7d55b388b568136ea62b57d /src/main/java/org/uic/barcode/Encoder.java
parentMerge pull request #34 from UnionInternationalCheminsdeFer/1.2.7 (diff)
parenttest and bug fix on countermark and viaStation (diff)
downloadUIC-barcode-1.2.8.tar
UIC-barcode-1.2.8.tar.gz
UIC-barcode-1.2.8.tar.bz2
UIC-barcode-1.2.8.tar.lz
UIC-barcode-1.2.8.tar.xz
UIC-barcode-1.2.8.tar.zst
UIC-barcode-1.2.8.zip
Diffstat (limited to 'src/main/java/org/uic/barcode/Encoder.java')
-rw-r--r--src/main/java/org/uic/barcode/Encoder.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/org/uic/barcode/Encoder.java b/src/main/java/org/uic/barcode/Encoder.java
index e906881..f0f8d14 100644
--- a/src/main/java/org/uic/barcode/Encoder.java
+++ b/src/main/java/org/uic/barcode/Encoder.java
@@ -100,7 +100,13 @@ public class Encoder {
DataType ticketData = new DataType();
UicRailTicketCoder uicTicketCoder = new UicRailTicketCoder();
- ticketData.setFormat(Constants.DATA_TYPE_FCB_VERSION_1);
+ if (fcbVersion == 1 || fcbVersion == 13) {
+ ticketData.setFormat(Constants.DATA_TYPE_FCB_VERSION_1);
+ } else if (fcbVersion == 2) {
+ ticketData.setFormat(Constants.DATA_TYPE_FCB_VERSION_2);
+ } else if (fcbVersion == 3) {
+ ticketData.setFormat(Constants.DATA_TYPE_FCB_VERSION_3);
+ }
ticketData.setData(new OctetString(uicTicketCoder.encode(ticket, fcbVersion)));
dynamicFrame.getLevel2SignedData().getLevel1Data().getData().add(ticketData);