From e8d7c20c77be36722cb480b8eb80e180e39e55a2 Mon Sep 17 00:00:00 2001 From: srowen Date: Tue, 20 Jan 2009 23:15:09 +0000 Subject: [PATCH] Issue 127: Add structured append mode and make it clear this is not supported git-svn-id: http://zxing.googlecode.com/svn/trunk@828 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- .../google/zxing/qrcode/decoder/DecodedBitStreamParser.java | 3 +++ core/src/com/google/zxing/qrcode/decoder/Mode.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/core/src/com/google/zxing/qrcode/decoder/DecodedBitStreamParser.java b/core/src/com/google/zxing/qrcode/decoder/DecodedBitStreamParser.java index 16bfb62a..519abdbc 100644 --- a/core/src/com/google/zxing/qrcode/decoder/DecodedBitStreamParser.java +++ b/core/src/com/google/zxing/qrcode/decoder/DecodedBitStreamParser.java @@ -80,6 +80,9 @@ final class DecodedBitStreamParser { if (mode.equals(Mode.FNC1_FIRST_POSITION) || mode.equals(Mode.FNC1_SECOND_POSITION)) { // We do little with FNC1 except alter the parsed result a bit according to the spec fc1InEffect = true; + } else if (mode.equals(Mode.STRUCTURED_APPEND)) { + // not supported + throw ReaderException.getInstance(); } else if (mode.equals(Mode.ECI)) { // Count doesn't apply to ECI try { diff --git a/core/src/com/google/zxing/qrcode/decoder/Mode.java b/core/src/com/google/zxing/qrcode/decoder/Mode.java index 20df2ca5..24117dcb 100644 --- a/core/src/com/google/zxing/qrcode/decoder/Mode.java +++ b/core/src/com/google/zxing/qrcode/decoder/Mode.java @@ -29,6 +29,7 @@ public final class Mode { public static final Mode TERMINATOR = new Mode(new int[]{0, 0, 0}, 0x00, "TERMINATOR"); // Not really a mode... public static final Mode NUMERIC = new Mode(new int[]{10, 12, 14}, 0x01, "NUMERIC"); public static final Mode ALPHANUMERIC = new Mode(new int[]{9, 11, 13}, 0x02, "ALPHANUMERIC"); + public static final Mode STRUCTURED_APPEND = new Mode(new int[]{0, 0, 0}, 0x03, "STRUCTURED_APPEND"); // Not supported public static final Mode BYTE = new Mode(new int[]{8, 16, 16}, 0x04, "BYTE"); public static final Mode ECI = new Mode(null, 0x07, "ECI"); // character counts don't apply public static final Mode KANJI = new Mode(new int[]{8, 10, 12}, 0x08, "KANJI"); @@ -58,6 +59,8 @@ public final class Mode { return NUMERIC; case 0x2: return ALPHANUMERIC; + case 0x3: + return STRUCTURED_APPEND; case 0x4: return BYTE; case 0x5: -- 2.20.1