Skip to content

Commit

Permalink
Desktop application connection bug fix.
Browse files Browse the repository at this point in the history
Fixed bug where pressing 'connect' on a device would attempt to conenct
all other devices which had previously connected, but had since
disconnected.
  • Loading branch information
leytonblackler committed Jan 28, 2017
1 parent f3fb909 commit abbed08
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Desktop/Chromolite_Desktop_2_6/Chromolite_Desktop_2_6.pde
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ void oscEvent(OscMessage incomingMessage) {

sendColour(type, incomingMessage.get(1).intValue(), incomingMessage.get(2).intValue(), incomingMessage.get(3).intValue(), incomingMessage.get(4).floatValue(), incomingMessage.get(5).floatValue(), mostRecentIP);
} else if (incomingMessage.addrPattern().equals("/connect")) {
println("received connect");
println("Received 'connect'.");

OscMessage replyMessage = new OscMessage("/connected");
if (toggleBlueLEDButton.isSelected()) {
Expand Down Expand Up @@ -605,10 +605,8 @@ void oscEvent(OscMessage incomingMessage) {

NetAddress destinationLocation;

for (String ip : connectedIPs) {
destinationLocation = new NetAddress(ip, currentPort);
oscP5.send(replyMessage, destinationLocation);
}
destinationLocation = new NetAddress(mostRecentIP, currentPort);
oscP5.send(replyMessage, destinationLocation);
} else {
println("Incoming message address pattern not recognised.");
}
Expand Down
2 changes: 2 additions & 0 deletions Desktop/Chromolite_Desktop_2_6/code/sketch.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mode=Java
mode.id=processing.mode.java.JavaMode

0 comments on commit abbed08

Please sign in to comment.