|
|
@ -40,7 +40,6 @@ static void doMaskDemo(void);
|
|
|
|
static void printQr(const uint8_t qrcode[]);
|
|
|
|
static void printQr(const uint8_t qrcode[]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// The main application program.
|
|
|
|
// The main application program.
|
|
|
|
int main(void) {
|
|
|
|
int main(void) {
|
|
|
|
doBasicDemo();
|
|
|
|
doBasicDemo();
|
|
|
@ -51,6 +50,9 @@ int main(void) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*---- Demo suite ----*/
|
|
|
|
|
|
|
|
|
|
|
|
// Creates a single QR Code, then prints it to the console.
|
|
|
|
// Creates a single QR Code, then prints it to the console.
|
|
|
|
static void doBasicDemo(void) {
|
|
|
|
static void doBasicDemo(void) {
|
|
|
|
const char *text = "Hello, world!"; // User-supplied text
|
|
|
|
const char *text = "Hello, world!"; // User-supplied text
|
|
|
@ -115,6 +117,7 @@ static void doVarietyDemo(void) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Creates QR Codes with manually specified segments for better compactness.
|
|
|
|
static void doSegmentDemo(void) {
|
|
|
|
static void doSegmentDemo(void) {
|
|
|
|
{ // Illustration "silver"
|
|
|
|
{ // Illustration "silver"
|
|
|
|
const char *silver0 = "THE SQUARE ROOT OF 2 IS 1.";
|
|
|
|
const char *silver0 = "THE SQUARE ROOT OF 2 IS 1.";
|
|
|
@ -290,6 +293,9 @@ static void doMaskDemo(void) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*---- Utilities ----*/
|
|
|
|
|
|
|
|
|
|
|
|
// Prints the given QR Code to the console.
|
|
|
|
// Prints the given QR Code to the console.
|
|
|
|
static void printQr(const uint8_t qrcode[]) {
|
|
|
|
static void printQr(const uint8_t qrcode[]) {
|
|
|
|
int size = qrcodegen_getSize(qrcode);
|
|
|
|
int size = qrcodegen_getSize(qrcode);
|
|
|
|