
Untitled
By: a guest on
Aug 8th, 2012 | syntax:
None | size: 0.61 KB | hits: 11 | expires: Never
/*
Simple example of sending an OSC message using oscpack.
*/
#include <oscpack/osc/OscOutboundPacketStream.h>
#include <oscpack/ip/UdpSocket.h>
#define ADDRESS "192.168.0.14"
#define PORT 7000
#define OUTPUT_BUFFER_SIZE 1024
int main(int argc, char* argv[])
{
UdpTransmitSocket transmitSocket( IpEndpointName( ADDRESS, PORT ) );
char buffer[OUTPUT_BUFFER_SIZE];
osc::OutboundPacketStream p( buffer, OUTPUT_BUFFER_SIZE );
p
<< osc::BeginMessage( "/mc" )
<< 23.0f << 23.0f << 3.1415f << 0.0f<<0.0f<<0.0f<<1.0f << osc::EndMessage;
transmitSocket.Send( p.Data(), p.Size() );
}