Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces the first iteration of the RGBoard RGB LED matrix display application that integrates with a queue-based backend for design retrieval.
- Implements a QueueClient class with JWT authentication, design fetching, and JSON parsing.
- Adds display functionality to render designs on an RGB matrix.
- Sets up a main program to initialize the display, perform authentication, and run a continuous design-fetching loop.
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| rgboard/src/queue-client.cpp | Implements QueueClient for JWT based authentication and design retrieval. |
| rgboard/src/main.cpp | Contains the main loop that initializes the matrix and renders designs. |
| rgboard/src/display.cpp | Provides functionality to convert hex color values and draw pixels on the canvas. |
| rgboard/include/queue-client.h | Declares the QueueClient class and its responsibilities. |
| rgboard/include/display.h | Declares the design drawing function for the RGB matrix. |
Files not reviewed (1)
- rgboard/Makefile: Language not supported
| std::string response; | ||
| Json::Value body; | ||
|
|
||
| // Doing this in C++ is crazy, even the IDE is confused. |
There was a problem hiding this comment.
[nitpick] Consider rephrasing or removing this informal comment to maintain a professional tone in the code.
| // Doing this in C++ is crazy, even the IDE is confused. | |
| // Constructing a JSON object with email and password fields. |
| std::string errs; | ||
| std::istringstream ss(raw); | ||
|
|
||
| if (!Json::parseFromStream(builder, ss, &parsed, &errs)) { | ||
| std::fprintf(stderr, "Failed to parse pixel_data string: %s\n", errs.c_str()); |
There was a problem hiding this comment.
[nitpick] Avoid redeclaring the 'errs' variable in nested scopes to prevent potential confusion; consider using a distinct name or consolidating error handling.
| std::string errs; | |
| std::istringstream ss(raw); | |
| if (!Json::parseFromStream(builder, ss, &parsed, &errs)) { | |
| std::fprintf(stderr, "Failed to parse pixel_data string: %s\n", errs.c_str()); | |
| std::string pixel_data_errs; | |
| std::istringstream ss(raw); | |
| if (!Json::parseFromStream(builder, ss, &parsed, &pixel_data_errs)) { | |
| std::fprintf(stderr, "Failed to parse pixel_data string: %s\n", pixel_data_errs.c_str()); |
|
Merge this with my PR code first. |
|
|
What I meant was to make sure that it works with the new code, hope that clears up any confusion. |
Ahh ok! I caught up. I'll update you with that soon. |
069fdcd to
153eb01
Compare
This pull request introduces a new RGB LED matrix display application (
rgboard) that integrates with a queue-based backend to fetch and render designs. The changes include the addition of aMakefilefor build automation, new header and source files for core functionality, and a main program to tie everything together.Build System
Makefileto define build rules, including compiler settings, source files, and linking with external libraries (libcurl,jsoncpp, and the RGB matrix library).Core Functionality
QueueClientinqueue-client.handqueue-client.cppto handle authentication and design retrieval from a backend API. This includes methods for obtaining a JWT token, fetching designs, and parsing JSON responses. [1] [2]display.handdisplay.cppto handle rendering of pixel designs onto the RGB matrix. Includes a utility function to convert hex color codes to RGB values and a function to draw designs on the canvas. [1] [2]Main Program
main.cppto initialize the RGB matrix, authenticate with the backend, and continuously fetch and display designs in a loop. Includes error handling for failed API calls and matrix initialization.To: @irsaris @PinkSylvie @Jandel7
This is so you guys can review and see what's going on internally. Please feel free to make any comments or ask questions.