private void genericReplyOnRelease(SmartphoneCommand command) { if (command.state == SmartphoneCommand.States.Released) { tool.confirmReception(command); } }
private void onDrawMesh(SmartphoneCommand command) { if (command.mode == SmartphoneCommand.Modes.DrawMesh && command.state == SmartphoneCommand.States.Released) { SmartphoneCommand c = new SmartphoneCommand(); c.mode = SmartphoneCommand.Modes.ExtrudeMesh; tool.sendCommand(c); } }
private void onTransform(SmartphoneCommand command) { if (command.mode == SmartphoneCommand.Modes.EndTransform && command.state == SmartphoneCommand.States.Released) { tool.confirmReception(command); } else if (command.mode == SmartphoneCommand.Modes.InDirectTrans && command.state == SmartphoneCommand.States.Released) { tool.confirmReception(command); } }
// Useful for sending a command locally only public void sendCommandToCallback(SmartphoneCommand command) { int commandValue = (int)command.commandType; if (commandValue < (int)SmartphoneCommand.Commands.Count) { // Specific callback if (onCommand[commandValue] != null) { onCommand[commandValue].Invoke(command); } } }
private void ResetClientLater() { // Because of the BluetoothToTCP man-in-the-middle, we may be connected // to the middle-man, but not yet to the device. // Send data continuously until we get a confirm while (!resetHasBeenConfirmed) { Thread.Sleep(200); SmartphoneCommand command = new SmartphoneCommand(); command.commandType = SmartphoneCommand.Commands.Reset; sendCommand(command); firstClientSinceLaunch = false; } }
public SmartphoneCommand(SmartphoneCommand c) { commandId = c.commandId; commandType = c.commandType; state = c.state; mode = c.mode; text = c.text; coord = c.coord; color = c.color; lines = new List <Line2D>(c.lines); floatValue = c.floatValue; returnValue = c.returnValue; populateListOfCommands(); }
private void replyWithSameCommand(SmartphoneCommand command) { tool.sendCommand(command); }
// public private void genericReply(SmartphoneCommand command) { tool.confirmReception(command); }
public void confirmReception(SmartphoneCommand command, int returnValue = 0) { command.commandType = SmartphoneCommand.Commands.ConfirmReception; command.returnValue = returnValue; sendCommand(command); }
public void sendCommand(SmartphoneCommand command) { //dataServer.sendData(SerializerTool.SerializeObject<SmartphoneCommand>(command)); //dataServer.sendData("Hello from Unity!"); }
private void OnResetConfirmed(SmartphoneCommand command) { resetHasBeenConfirmed = true; }