From 46f00829df94484f49ccd3523d770bbf152952e0 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Tue, 18 Jun 2024 01:57:28 -0700 Subject: [PATCH 1/3] address build warnings about ncurses example resolves #241 --- examples_RPi/ncurses/RF24Mesh_Ncurses_Master.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/examples_RPi/ncurses/RF24Mesh_Ncurses_Master.cpp b/examples_RPi/ncurses/RF24Mesh_Ncurses_Master.cpp index 34e2852..3767b03 100644 --- a/examples_RPi/ncurses/RF24Mesh_Ncurses_Master.cpp +++ b/examples_RPi/ncurses/RF24Mesh_Ncurses_Master.cpp @@ -216,7 +216,7 @@ void drawTopology() wclear(topoPad); wattroff(topoPad, COLOR_PAIR(1)); mvprintw(17, 10, "Mesh Topology"); - mvwprintw(topoPad, nodeY > 15 ? nodeY - 16 : 0, 0, ""); + mvwaddch(topoPad, nodeY > 15 ? nodeY - 16 : 0, 0, 0); wattron(topoPad, COLOR_PAIR(1)); int topoPadmaxX; topoPadmaxX = getmaxx(topoPad); @@ -238,9 +238,7 @@ void drawTopology() for (int j = 0; j < mesh.addrListTop; j++) { if (mesh.addrList[j].address == i) { - int y = 0; - int x = 0; - getyx(topoPad, y, x); + int x = getcurx(topoPad); if (x >= topoPadmaxX) wprintw(topoPad, "\n"); wprintw(topoPad, "0%o[%d] ", mesh.addrList[j].address, mesh.addrList[j].nodeID); } @@ -258,9 +256,7 @@ void drawTopology() for (int j = 0; j < mesh.addrListTop; j++) { if (mesh.addrList[j].address == i) { - int y = 0; - int x = 0; - getyx(topoPad, y, x); + int x = getcurx(topoPad); if (x >= topoPadmaxX) wprintw(topoPad, "\n"); wprintw(topoPad, "0%o[%d] ", mesh.addrList[j].address, mesh.addrList[j].nodeID); } @@ -278,9 +274,7 @@ void drawTopology() for (int j = 0; j < mesh.addrListTop; j++) { if (mesh.addrList[j].address == i) { - int y = 0; - int x = 0; - getyx(topoPad, y, x); + int x = getcurx(topoPad); if (x >= topoPadmaxX) wprintw(topoPad, "\n"); wprintw(topoPad, "0%o[%d] ", mesh.addrList[j].address, mesh.addrList[j].nodeID); } From 22de2f1407619af453268696eac92b86c27c4565 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Thu, 20 Jun 2024 05:57:25 -0700 Subject: [PATCH 2/3] update example intro comment --- examples_RPi/ncurses/RF24Mesh_Ncurses_Master.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples_RPi/ncurses/RF24Mesh_Ncurses_Master.cpp b/examples_RPi/ncurses/RF24Mesh_Ncurses_Master.cpp index 3767b03..3a3f7d6 100644 --- a/examples_RPi/ncurses/RF24Mesh_Ncurses_Master.cpp +++ b/examples_RPi/ncurses/RF24Mesh_Ncurses_Master.cpp @@ -8,10 +8,13 @@ * Requirements: NCurses * Install NCurses: apt-get install libncurses5-dev * Setup: - * 1: make - * 2: sudo ./RF24Mesh_Ncurses_Master + * 1. cd ~/RF24Mesh/examples_RPi + * 2. mkdir build && cd build + * 3. cmake .. + * 4. make + * 5. ./ncurses/RF24Mesh_Ncurses_Master * - * NOTE: DEBUG MUST BE DISABLED IN RF24Mesh_config.h + * NOTE: RF24MESH_DEBUG MUST BE DISABLED IN RF24Mesh_config.h * * Once configured and running, the interface will display the header information, data rate, * and address assignments for all connected nodes.* From f49f1c3747f2de5fe8e39611ec43e1588bbd9229 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Fri, 21 Jun 2024 11:47:01 -0700 Subject: [PATCH 3/3] remove static address assignment --- examples_RPi/ncurses/RF24Mesh_Ncurses_Master.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/examples_RPi/ncurses/RF24Mesh_Ncurses_Master.cpp b/examples_RPi/ncurses/RF24Mesh_Ncurses_Master.cpp index 3a3f7d6..166b31e 100644 --- a/examples_RPi/ncurses/RF24Mesh_Ncurses_Master.cpp +++ b/examples_RPi/ncurses/RF24Mesh_Ncurses_Master.cpp @@ -56,7 +56,6 @@ int main() return 0; } radio.printDetails(); - mesh.setStaticAddress(8, 01); win = initscr(); /* Start curses mode */ getmaxyx(win, maxX, maxY); start_color();