Skip to content

Conversation

@jcelerier
Copy link
Contributor

@jcelerier jcelerier commented Dec 29, 2025

This will allow users to create DMIs that won't require reboots

@cbicari
Copy link
Member

cbicari commented Dec 30, 2025

from template review branch :
in [basic-osc/src/main.cpp]
OSCMessage msg1(("/" + puara.dmi_name()).c_str());
msg1.add(sensor);
Udp.beginPacket(puara.IP1().c_str(), puara.PORT1());
Udp.beginPacket(oscIP_1.c_str(), oscPort_1);

Since in this example we are reloading the ip / port on each loop() tick, it wouldn't be slower to just do

auto ip = puara.getVarText("oscIP");
auto port = puara.getVarNumber("oscPort");
if(!ip.empty() && ip != "0.0.0.0") {
..
Udp.beginPacket(ip.c_str(), port);
}

this way updates to the web ui would be taken into account directly

@jcelerier jcelerier force-pushed the feature/settings_callback branch from f29d50f to 2d52e7a Compare December 30, 2025 17:36
@jcelerier
Copy link
Contributor Author

About what I said in the above comment: this was in the case where we only have simple logic.

If we have a very basic system that just sends OSC messages, then it's going to be exactly as performant to just re-read the OSC address & port on each loop() as they just get read from a local cache.

If we have something more advanced, for instance not just a OSC client but also an OSC server, then it is necessary to have the callback so that we can stop & restart the server with the correct new port, if the user changed it as part of the settings.

Cheers!

@jcelerier
Copy link
Contributor Author

TODO: rebase when #38 is merged so that we can check whether this doesn't break CI

@jcelerier jcelerier force-pushed the feature/settings_callback branch from 2d52e7a to fc265ed Compare January 5, 2026 16:13
Copy link
Member

@cbicari cbicari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compiles all tests :)
could test with templates too

@cbicari cbicari merged commit 86092e6 into main Jan 5, 2026
100 checks passed
@cbicari cbicari deleted the feature/settings_callback branch January 5, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants