@@ -23,22 +23,49 @@ Version: 0
2323Message: your content here
2424```
2525
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+
2653### Message Format
2754qrcodes support 4 formats called "modes": numeric, alpha-numeric, binary, and
2855kanji. Because of the limited screen real-estate on the [ Flipper Zero] , you'll
2956want to pick the best mode for the data you are trying to display.
3057
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.
3760
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".
4067
41- #### Alpha-Numeric Mode
68+ #### Alpha-Numeric Mode (QRMode: A)
4269This mode can encode numbers, uppercase letters * only* , spaces, and the
4370following symbols: ` $%*+-./: ` . This format _ may_ be appropriate for urls, as
4471long as you're only encoding the domain name and you remember to use uppercase
@@ -48,30 +75,56 @@ case-sensitive.
4875
4976A qrcode in alpha-numeric mode can encode ~ 40% less data than numeric mode.
5077
51- #### Binary Mode
78+ #### Binary Mode (QRMode: B)
5279This mode is a little bit of a misnomer: binary mode simply means that the
5380message will be encoded as 8-bit bytes. The qrcode standard stipulates that
5481text will use ISO-8859-1 (also known as Latin-1) encoding, _ not_ utf8 as would
5582be the standard these days. However, _ some_ readers _ may_ automatically detect
5683utf8. To be standard-compliant, that basically means you can only use Latin
5784letters, numbers, and symbols.
5885
86+ Multi-line messages will always be in binary mode, since the other modes cannot
87+ encode a newline character.
88+
5989A qrcode in binary mode can encode ~ 60% less data than numeric mode, and ~ 30%
6090less than alpha-numeric.
6191
62- #### Kanji Mode
92+ #### Kanji Mode (QRMode: K)
6393This mode is unsupported, so I won't go into detail. A limitation of the
6494underlying qrcode library that I'm using, unfortunately. If there's interest,
6595perhaps I'll hack in support sometime.
6696
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+
67122## Using the App
68123The app is fairly straightforward. When it first starts, the file browser will
69124automatically open to the ` qrcodes ` directory and display any ` .qrcode ` files.
70125Select 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).
75128
76129While viewing the stats, you can select Version or ECC using the up and down
77130arrows and the center button. You can then increase or decrease the Version or
@@ -120,6 +173,27 @@ For example, if my ssid was "wifiball" and not broadcast, and the password was
120173Message: WIFI:S:wifiball;P:pa$$\:word;T:WPA;H:true;
121174```
122175
176+ ## Example: vCard
177+ Phones can scan [ vCard] qrcodes to automatically add a contact to their address
178+ book. Starting with qrcode v2, multi-line qrcodes can be created, allowing you
179+ to create vCards!
180+
181+ ```
182+ Filetype: QRCode
183+ Version: 1
184+ Message: BEGIN:VCARD
185+ Message: VERSION:3.0
186+ Message: N:Smith;John
187+ Message: FN:John Smith
188+ Message: ADR;TYPE=dom,home,postal,parcel:;;123 Example St;Exampleton;CA;90210;
189+ Message: BDAY:1970-01-01
190+ Message: TEL;TYPE=pref,voice,msg,cell:+18005551212
191+ Message: END:VCARD
192+ ```
193+
194+ Check the [ vCard] specification to learn about all of the fields and their
195+ values.
196+
123197## Building
124198First, clone the [ flipperzero-firmware] repo and then clone this repo in the
125199` applications_user ` directory:
133207Next, in the base of the [ flipperzero-firmware] directory, run fbt:
134208
135209``` bash
136- cd ..
137210./fbt fap_qrcode
138211```
139212
@@ -146,11 +219,12 @@ find the .fap, should it change in the future).
146219This application uses the [ QRCode] library by ricmoo. This is the same library
147220that is in the lib directory of the flipper-firmware repo (which was originally
148221included for a [ now-removed demo app] ), but modified slightly to fix some
149- compiler errors.
222+ compiler errors and allow the explicit selection of the qrcode mode .
150223
151224[ now-removed demo app ] : https://github.com/flipperdevices/flipperzero-firmware/pull/160/files
152225[ flipperzero-firmware ] : https://github.com/flipperdevices/flipperzero-firmware
153226[ Flipper Zero ] : https://flipperzero.one/
154227[ QRCode ] : https://github.com/ricmoo/QRCode
155228[ qFlipper ] : https://docs.flipperzero.one/qflipper
156229[ Releases ] : https://github.com/bmatcuk/flipperzero-qrcode/releases/latest
230+ [ vCard ] : https://www.evenx.com/vcard-3-0-format-specification
0 commit comments