Skip to content

Commit

Permalink
fix osc not sending feedback if not connected
Browse files Browse the repository at this point in the history
  • Loading branch information
benkuper committed Jul 5, 2024
1 parent 29b3817 commit 4b71707
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ void OSCComponent::processMessage(OSCMessage &msg)

void OSCComponent::sendMessage(OSCMessage &msg)
{
if (!enabled || remoteHost.length() == 0)
if (!udpIsInit || !enabled || remoteHost.length() == 0)
return;

if (WifiComponent::instance->state != WifiComponent::Connected)
return;

char addr[32];
Expand All @@ -161,7 +164,10 @@ void OSCComponent::sendMessage(OSCMessage &msg)

void OSCComponent::sendMessage(String address)
{
if (!enabled || remoteHost.length() == 0)
if (!udpIsInit || !enabled || remoteHost.length() == 0)
return;

if (WifiComponent::instance->state != WifiComponent::Connected)
return;

OSCMessage m(address.c_str());
Expand All @@ -170,7 +176,10 @@ void OSCComponent::sendMessage(String address)

void OSCComponent::sendMessage(const String &source, const String &command, var *data, int numData)
{
if (!enabled || remoteHost.length() == 0)
if (!udpIsInit || !enabled || remoteHost.length() == 0)
return;

if (WifiComponent::instance->state != WifiComponent::Connected)
return;

OSCMessage msg = createMessage(source, command, data, numData, true);
Expand Down

0 comments on commit 4b71707

Please sign in to comment.