private void Button2_Tapped_1(object sender, TappedRoutedEventArgs e) { if (InterfaceCommand != null) { InterfaceCommand.Execute(null); } }
public CommandHandler( BillToBillDevice device, InterfaceCommand interfaceCommand, byte[] commandData) : base(device) { m_CommandData = commandData; m_InterfaceCommand = interfaceCommand; }
static void Main(string[] args) { Response response = new Response(); response.ResponseStatus = "ok"; //ConcreteCommand command = new ConcreteCommand(); //switch with line below to test inteface InterfaceCommand command = new InterfaceCommand(); command.Execute(); response.Results = command.Results; List <Type> knownTypes = new List <Type> { typeof(MyObject), typeof(Result <MyObject>) //switch with line below to test inteface //typeof(Result<IMyObject>) }; DataContractJsonSerializer serializer = new DataContractJsonSerializer(response.GetType(), knownTypes, int.MaxValue, false, null, true); Stream stream = new MemoryStream(); serializer.WriteObject(stream, response); stream.Position = 0; StreamReader reader = new StreamReader(stream); string output = reader.ReadToEnd(); Console.WriteLine(output); }
public MessageCmd(InterfaceAddress interfaceAddr, InterfaceCommand interfaceCommand, byte[] data) : base(interfaceAddr) { m_InterfaceCmd = interfaceCommand; m_Data = data; }
void SendCmdMessage( InterfaceCommand interfaceCommand, byte[] data) { var cmdMessage = new MessageCmd( m_InterfaceAddress, interfaceCommand, data); //get message data bytes var sendData = cmdMessage.GetSendingData(); //send data bytes at port SendMessageLow(sendData); }
bool HandleCommandWithRetData( InterfaceCommand command, byte[] commandData, out byte[] responseData) { bool commandHandledSuccessfully = false; //send command at device m_Device.SendCmdMessage(command, commandData); //wait timeout response filled Thread.Sleep(B2B_RETURN_ACK_TIMEOUT_MSEC); if (Helper.GetDeviceCmdResponse( m_Device.m_CommunicationPort, out responseData) && Response.CheckDataPacket(responseData) && NakResponse.CheckData(responseData) == false) { commandHandledSuccessfully = true; } return(commandHandledSuccessfully); }
bool HandleCommandWithNoRetData( InterfaceCommand command, byte[] commandData) { bool commandHandledSuccessfully = false; lock (m_PortLocker) { byte[] responseData; SendCmdMessage(command, commandData); Thread.Sleep(B2B_RETURN_ACK_TIMEOUT_MSEC); if (Helper.GetDeviceCmdResponse(m_CommunicationPort, out responseData) && Response.CheckDataPacket(responseData) && AckResponse.CheckData(responseData) ) { //SendAckMessage(); //GetAckMessage(); commandHandledSuccessfully = true; } } return(commandHandledSuccessfully); }
public CmdHandlerWithoutRetData(BillToBillDevice device, InterfaceCommand interfaceCommand) : base(device) { m_InterfaceCommand = interfaceCommand; }
public PollCmdHandler(BillToBillDevice device, InterfaceCommand command, byte[] commandData) : base( device, command, commandData) { }
public void Execute(T0 p0, T1 p1, T2 p2, T3 p3, T4 p4, T5 p5, T6 p6, T7 p7, T8 p8, T9 p9) { SetValues(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9); InterfaceCommand.Execute(); }