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())); }
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); }
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(); } }
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); }
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); }