Ken Van Hoeylandt 56ddd4b355
Mesh Chat apps, ESP-NOW mesh radio, and shared Wi-Fi radio ownership (#698)
Mesh gets contacts, channels, delivery receipts, QR sharing and an ESP-NOW radio. Mesh Chat is split into Mesh Contacts and Mesh Channels, `mesh inspect` replaces the Mesh Inspect app, and ESP-NOW and Wi-Fi now share the Wi-Fi radio safely.
2026-10-17 18:56:27 +02:00

41 lines
1.3 KiB
C

// SPDX-License-Identifier: Apache-2.0
#pragma once
#include <lvgl.h>
#include <tactility/error.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Creates a QR code view. It draws the code with square modules of a whole number of pixels,
* centered in the object and surrounded by the quiet zone that scanners need.
* Give it a size, and set the data with lvgl_qr_set_data().
* @param[in] parent the parent object for the new view
* @return the created view
*/
lv_obj_t* lvgl_qr_create(lv_obj_t* parent);
/**
* @brief Sets the text or bytes to encode, in the smallest QR version that fits (low error correction).
* The view keeps showing the previous code when this fails.
* @param[in] obj a view created with lvgl_qr_create()
* @param[in] data the NUL-terminated data, at most 1273 bytes
* @retval ERROR_NONE on success
* @retval ERROR_OUT_OF_RANGE when the data doesn't fit in a QR code
* @retval ERROR_OUT_OF_MEMORY when the code couldn't be allocated
*/
error_t lvgl_qr_set_data(lv_obj_t* obj, const char* data);
/**
* @brief Sets the colors of the modules and of the background, including the quiet zone.
* Scanners need a dark code on a light background, so these are black and white by default.
*/
void lvgl_qr_set_colors(lv_obj_t* obj, lv_color_t dark, lv_color_t light);
#ifdef __cplusplus
}
#endif