-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get messages from packets? #16
Comments
Searching through the source code, I found OSCPacket.data() seems more relevant, but the I can convert that data to a string and then feed it into Surely there is a more direct way to do this. I'm starting to think casting the packet, as in the one bit of example code I've found, is the way, but Xcode still sees those as unrelated types. |
Hey @arlomedia, Apologise for the delayed response. switch packet {
case let .bundle(bundle):
print("Received: \(bundle)")
case let .message(message):
print("Received: \(message)")
} If you know you know you'll just be receiving OSC Messages you can do the following: if case let .message(message) = packet {
print("Received: \(message)")
} |
Can someone show how to get an OSCMessage from the OSCPacket that the client and server callback functions deliver?
The OSCKit ReadMe shows the callback functions but with no code inside. This issue shows a cast from OSCPacket to OSCBundle, but Xcode tells me that will always fail, and if I try it anyway it does fail. I'm looking at the source code for OSCPacket, but I don't understand what it's doing. When I search the web, I just find other projects that also use the OSCKit, OSCCore or OSCPacket names.
I can see from the debugger output below that the message data I'm looking for is right there in the OSCPacket, but I can't find the syntax for getting it.
The text was updated successfully, but these errors were encountered: