protected override bool ProcessMessage(OSCMessage message, out byte[] value)
        {
            value = null;

            if (message.ToBlob(out value))
            {
                return(true);
            }

            return(false);
        }
        protected override void Invoke(OSCMessage message)
        {
            byte[] value;

            if (message.ToBlob(out value))
            {
                if (onReceive != null)
                {
                    onReceive.Invoke(value);
                }
            }
        }
Exemple #3
0
        // RECEIVER
        public void ReceiveBlob(OSCMessage message)
        {
            byte[] value;

            if (message.ToBlob(out value))
            {
                var bytesString = string.Empty;

                for (var index = 0; index < value.Length; index++)
                {
                    bytesString += "0x" + string.Format("{0:x2}", value[index]).ToUpper() + " ";
                }

                ReceiverTextBlob.text = bytesString.Remove(bytesString.Length - 1);
            }
        }
        public void ReceiveMessage(OSCMessage message)
        {
            byte[] bytes;

            // Get bytes from message
            if (!message.ToBlob(out bytes))
            {
                return;
            }

            // Convert bytes to structure!
            var structure = OSCUtilities.ByteToStruct <MarshallingStructure>(bytes);

            Debug.LogFormat("Received structure with data:\nIntValue: {0}\nStringValue: {1}\nFloatValue: {2}",
                            structure.IntValue, structure.StringValue, structure.FloatValue);
        }
 protected override bool ProcessMessage(OSCMessage message, out byte[] value) => message.ToBlob(out value);