//TODO: check that this actually happens as the specification is a little ambigous protected override bool ValidResponse(Packet packet) { if (packet.Header == PacketHeaderType.CommandStationOperationResponse && packet.Payload[0] == Convert.ToByte(PacketIdentifier.CommandStationOperationResponse.ServiceModeEntryBroadcast)) { ResponseData = new GeneralResponse(); return true; } else { return false; } }
protected override bool ValidResponse(Packet packet) { if (packet.Header == PacketHeaderType.CommandStationOperationResponse && packet.Payload[0] == Convert.ToByte(PacketIdentifier.CommandStationOperationResponse.ServiceModeForRegisterAndPagedMode)) { ResponseData = new ServiceModeProgrammingResultsResp(); return true; } else if (packet.Header == PacketHeaderType.CommandStationOperationResponse && packet.Payload[0] == Convert.ToByte(PacketIdentifier.CommandStationOperationResponse.ServiceModeForDirectCvMode)) { ResponseData = new ServiceModeProgrammingResultsResp(); return true; } else if (packet.Header == PacketHeaderType.CommandStationOperationResponse && packet.Payload[0] == Convert.ToByte(PacketIdentifier.CommandStationOperationResponse.ProgrammingInfoDataByteNotFound)) { ResponseData = new GeneralResponse(); return true; } else if (packet.Header == PacketHeaderType.CommandStationOperationResponse && packet.Payload[0] == Convert.ToByte(PacketIdentifier.CommandStationOperationResponse.ProgrammingInfoShortCircuit)) { ResponseData = new GeneralResponse(); return true; } else if (packet.Header == PacketHeaderType.CommandStationOperationResponse && packet.Payload[0] == Convert.ToByte(PacketIdentifier.CommandStationOperationResponse.ProgrammingInfoCommandStationBusy)) { ResponseData = new GeneralResponse(); return true; } else if (packet.Header == PacketHeaderType.CommandStationOperationResponse && packet.Payload[0] == Convert.ToByte(PacketIdentifier.CommandStationOperationResponse.ProgrammingInfoCommandStationReady)) { ResponseData = new GeneralResponse(); return true; } else if (packet.Header == PacketHeaderType.CommandStationOperationResponse && packet.Payload[0] == Convert.ToByte(PacketIdentifier.CommandStationOperationResponse.InstructionUnsupported)) { ResponseData = new GeneralResponse(); return true; } else { return false; } }