Ejemplo n.º 1
0
        private void _SendModePic()
        {
            IHelloMessageData idata = DeviceHelloMessage.RecievedMessage.Data;
            var msg = Message.CreateModeMessage(MessageDataContainer.ModeType.Pic);

            CardBoardInterface.WriteDataBytes(
                Message2BytesComposer.ComposeMessageBytes(msg)
                , new IPEndPoint(idata.GetAdress(), idata.GetPort()));
        }
Ejemplo n.º 2
0
        private void _SendSettingsRequet()
        {
            Message msg = Message.CreateSettingsMessage(
                MessageDataContainer.MissionRequest, 0, 0, 0, 0
                , DeviceHelloMessage.LocalEnpPoint.Address, CardBoardInterface.GetServerPort());
            IHelloMessageData idata = DeviceHelloMessage.RecievedMessage.Data;

            CardBoardInterface.WriteDataBytes(
                Message2BytesComposer.ComposeMessageBytes(msg)
                , new IPEndPoint(idata.GetAdress(), idata.GetPort()));

            DeviceStatus = StatusWaiting;
            UpdateDeviceStatus(idata.GetName(), DeviceStatus);
        }
Ejemplo n.º 3
0
        private void buttonPing_Click(object sender, EventArgs e)
        {
            lock (SyncStatus)
            {
                var helloMessageData = (IHelloMessageData)(DeviceHelloMessage.RecievedMessage.Data);
                var remoteAddress    = new IPEndPoint(helloMessageData.GetAdress(), helloMessageData.GetPort());

                var msg = Message.CreatePingMessage();
                CardBoardInterface.WriteDataBytes(Message2BytesComposer.ComposeMessageBytes(msg), remoteAddress);

                _SendModeSettings();
                _SendSettingsRequet();
            }
        }
Ejemplo n.º 4
0
        private void listBoxVirtualCardboardDevices_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listBoxVirtualCardboardDevices.Items.Count <= 0)
            {
                return;
            }

            int selectedIndex = listBoxVirtualCardboardDevices.SelectedIndex;

            var helloMessageData = (IHelloMessageData)(VirtualCardboardDevicesList[selectedIndex].RecievedMessage.Data);
            var remoteAddress    = new IPEndPoint(helloMessageData.GetAdress(), helloMessageData.GetPort());

            var msg = Message.CreatePingMessage();

            CardBoardInterface.WriteDataBytes(Message2BytesComposer.ComposeMessageBytes(msg), remoteAddress);
        }
Ejemplo n.º 5
0
        protected void _SendSettingsRequestAssign()
        {
            Message msg = Message.CreateSettingsMessage(
                MessageDataContainer.MissionRequest | MessageDataContainer.MissionAssign
                , (int)numericUpDownEyesDistance.Value
                , (int)numericUpDownVerticalPosition.Value
                , (int)numericUpDownWidth.Value
                , (int)numericUpDownHeigh.Value
                , DeviceHelloMessage.LocalEnpPoint.Address, CardBoardInterface.GetServerPort());
            IHelloMessageData idata = DeviceHelloMessage.RecievedMessage.Data;

            CardBoardInterface.WriteDataBytes(
                Message2BytesComposer.ComposeMessageBytes(msg)
                , new IPEndPoint(idata.GetAdress(), idata.GetPort()));

            DeviceStatus = StatusWaiting;
            UpdateDeviceStatus(idata.GetName(), DeviceStatus);
        }