@@ -23,22 +23,49 @@ Version: 0
23
23
Message: your content here
24
24
```
25
25
26
+ qrcode v2 supports a newer format as well (the old format still works for
27
+ backward compatibility, or, if you don't need the newer features, the app will
28
+ read version "0" files faster):
29
+
30
+ ```
31
+ Filetype: QRCode
32
+ Version: 1
33
+ QRMode: B
34
+ QRVersion: 6
35
+ QRECC: L
36
+ Message: your content here
37
+ Message: multi-line content is possible
38
+ ```
39
+
40
+ In a version "1" file, the ` QRMode ` , ` QRVersion ` , and ` QRECC ` are optional
41
+ (though, must be in that order if more than one are specified). The app will
42
+ attempt to use the specified mode, version, and/or ECC, if the content will
43
+ fit. Otherwise, it may select a different mode, version, and/or ECC. Keep
44
+ reading to learn about the meaning of ` QRMode ` , ` QRVersion ` , and ` QRECC ` .
45
+
46
+ Version "1" files also support multi-line content. Each line starting with
47
+ ` Message: ` will be concatenated together with newline characters.
48
+
49
+ My recommendation is to allow the app to select a mode, version, and ECC level
50
+ for you and, then, if you find that your qrcode reader prefers specific
51
+ settings, update the file appropriately.
52
+
26
53
### Message Format
27
54
qrcodes support 4 formats called "modes": numeric, alpha-numeric, binary, and
28
55
kanji. Because of the limited screen real-estate on the [ Flipper Zero] , you'll
29
56
want to pick the best mode for the data you are trying to display.
30
57
31
- The app will automatically detect the best mode to use, so the only thing you
32
- need to do is make sure the message in your file is formatted to use the best
33
- mode. For example, if your message is entirely numeric, make sure you don't
34
- include any extraneous punctuation in your file. If you're only encoding a
35
- domain name, make sure it's uppercase to take advantage of alpha-numeric mode,
36
- etc.
58
+ If unspecified in the ` .qrcode ` file, the app will automatically detect the
59
+ best mode to use based on the message content.
37
60
38
- #### Numeric Mode
39
- Consists of only numbers, nothing else. This mode can encode the most data.
61
+ #### Numeric Mode (QRMode: N)
62
+ Consists of only numbers, nothing else. This mode can encode the most data and
63
+ is useful for things like phone numbers. To use this mode, your message must
64
+ _ not_ contain non-numeric characters. For example, a message content of "(xxx)
65
+ xxx-xxxx" can _ not_ use numeric mode (it would require "binary" mode, in fact).
66
+ Instead, your message should just be "xxxxxxxxxx".
40
67
41
- #### Alpha-Numeric Mode
68
+ #### Alpha-Numeric Mode (QRMode: A)
42
69
This mode can encode numbers, uppercase letters * only* , spaces, and the
43
70
following symbols: ` $%*+-./: ` . This format _ may_ be appropriate for urls, as
44
71
long as you're only encoding the domain name and you remember to use uppercase
@@ -48,30 +75,56 @@ case-sensitive.
48
75
49
76
A qrcode in alpha-numeric mode can encode ~ 40% less data than numeric mode.
50
77
51
- #### Binary Mode
78
+ #### Binary Mode (QRMode: B)
52
79
This mode is a little bit of a misnomer: binary mode simply means that the
53
80
message will be encoded as 8-bit bytes. The qrcode standard stipulates that
54
81
text will use ISO-8859-1 (also known as Latin-1) encoding, _ not_ utf8 as would
55
82
be the standard these days. However, _ some_ readers _ may_ automatically detect
56
83
utf8. To be standard-compliant, that basically means you can only use Latin
57
84
letters, numbers, and symbols.
58
85
86
+ Multi-line messages will always be in binary mode, since the other modes cannot
87
+ encode a newline character.
88
+
59
89
A qrcode in binary mode can encode ~ 60% less data than numeric mode, and ~ 30%
60
90
less than alpha-numeric.
61
91
62
- #### Kanji Mode
92
+ #### Kanji Mode (QRMode: K)
63
93
This mode is unsupported, so I won't go into detail. A limitation of the
64
94
underlying qrcode library that I'm using, unfortunately. If there's interest,
65
95
perhaps I'll hack in support sometime.
66
96
97
+ ### QRVersion
98
+ A qrcode's version specifies how "big" it is. Higher versions contain more
99
+ "modules" (ie, the "pixels" that make up qrcodes) and, thus, can encode more
100
+ data. A version 1 qrcode contains 21x21 modules, whereas a version 11 code (the
101
+ largest the Flipper Zero can display) contains 61x61 modules. The modules of a
102
+ version 1 code will be 3x3 pixels on the Flipper Zero screen; version 2 and 3
103
+ qrcodes will each have 2x2 pixel modules; and version 4 through 11 qrcodes will
104
+ have single pixel modules.
105
+
106
+ If unspecified in the ` .qrcode ` file, the app will automatically select the
107
+ lowest version that can contain all of the message content, given the mode
108
+ selected in the previous step.
109
+
110
+ ### QRECC
111
+ A qrcode's ECC level determines the qrcode's resilience to "damage". In the
112
+ case of the Flipper Zero, "damage" might be a dirty screen, dead pixels, or
113
+ even screen glare. Higher ECC modes are more resilient, but can contain less
114
+ data. The ECC modes are Low, Medium, Quartile, and High and can be specified in
115
+ the ` .qrcode ` file using the first letter (L, M, Q, and H).
116
+
117
+ qrcode readers may have an easier time reading qrcodes with higher ECC levels,
118
+ so, if unspecified in the ` .qrcode ` file, the app will select the highest ECC
119
+ level that can contain all of the message content, given the qrcode mode and
120
+ version selected in the previous steps.
121
+
67
122
## Using the App
68
123
The app is fairly straightforward. When it first starts, the file browser will
69
124
automatically open to the ` qrcodes ` directory and display any ` .qrcode ` files.
70
125
Select one using the arrow keys and the center button. The qrcode will display.
71
- If you push the right arrow, some stats will display: the qrcode "Version" -
72
- which corresponds to how big it is; the ECC level - which determines the
73
- qrcode's resilience to damage, such as a dirty screen (Low, Medium, Quartile,
74
- and High); and the qrcode Mode (Numeric, Alpha-Numeric, Binary, or Kanji).
126
+ If you push the right arrow, some stats will display: the qrcode "Version"; the
127
+ ECC level; and the qrcode Mode (Numeric, Alpha-Numeric, Binary, or Kanji).
75
128
76
129
While viewing the stats, you can select Version or ECC using the up and down
77
130
arrows and the center button. You can then increase or decrease the Version or
@@ -133,7 +186,6 @@ git clone git@github.com:bmatcuk/flipperzero-qrcode.git
133
186
Next, in the base of the [ flipperzero-firmware] directory, run fbt:
134
187
135
188
``` bash
136
- cd ..
137
189
./fbt fap_qrcode
138
190
```
139
191
@@ -146,7 +198,7 @@ find the .fap, should it change in the future).
146
198
This application uses the [ QRCode] library by ricmoo. This is the same library
147
199
that is in the lib directory of the flipper-firmware repo (which was originally
148
200
included for a [ now-removed demo app] ), but modified slightly to fix some
149
- compiler errors.
201
+ compiler errors and allow the explicit selection of the qrcode mode .
150
202
151
203
[ now-removed demo app ] : https://github.com/flipperdevices/flipperzero-firmware/pull/160/files
152
204
[ flipperzero-firmware ] : https://github.com/flipperdevices/flipperzero-firmware
0 commit comments