示例#1
0
    void Start()
    {
        // start discoverability, telling people who know discoveryIdentifier about OSCPort
        myBeacon            = new BeaconLib.Beacon(discoveryIdentifier, OSCPort);
        myBeacon.BeaconData = "";
        myBeacon.Start();

        // start OSC listener on port OSCPort
        // define the callback
        SharpOSC.HandleOscPacket listenerCallback = delegate(SharpOSC.OscPacket packet)
        {
            // get message
            SharpOSC.OscMessage messageReceived = (SharpOSC.OscMessage)packet;

            // send message along to be processed on the main thread in Update()
            myOSCIncomingMessages.Enqueue(Tuple.Create(messageReceived.Address, messageReceived.Arguments));
        };

        // tell the callback our hidden action
        ListenForMessage("/___broadcastToMePlease___", RespondToNewListener);

        // set up the callback
        myListener = new SharpOSC.UDPListener(OSCPort, listenerCallback);
    }
示例#2
0
        private void BroadcastProbe()
        {
            var probe = Beacon.Encode(BeaconType).ToArray();

            udp.Send(probe, probe.Length, new IPEndPoint(IPAddress.Broadcast, Beacon.DiscoveryPort));
        }
示例#3
0
 void Start()
 {
     myBeacon            = new BeaconLib.Beacon(discoveryIdentifier, communicationPort);
     myBeacon.BeaconData = otherData;
     myBeacon.Start();
 }