/// <summary> /// Constructor. Initialises statuses and registered command array. /// </summary> /// <param name="port">The port which the RX engine is going to use to receive data from.</param> public Rx(Clide.Port port) { // Create new data table dataTable1 = new DataTable(); statusArray.ok.id = StatusId_t.Ok; statusArray.ok.message = "O.K."; statusArray.dataIdDidNotMatch.id = StatusId_t.DataIdDidNotMatch; statusArray.dataIdDidNotMatch.message = "Data ID did not match."; statusArray.packetDecodingPassed.id = StatusId_t.PacketDecodingPassed; statusArray.packetDecodingPassed.message = "Packet successfully decoded."; statusArray.rxBufferOverflow.id = StatusId_t.RxBufferOverflow; statusArray.rxBufferOverflow.message = "RX buffer overflow."; statusArray.unrecognisedCmd.id = StatusId_t.PacketDecodingFailed; statusArray.unrecognisedCmd.message = "Received unrecognised command."; statusArray.packetUnexpectedlyTruncated.id = StatusId_t.PacketUnexpectedlyTruncated; statusArray.packetUnexpectedlyTruncated.message = "Packet unexpectedly truncated."; statusArray.incorrectNumParameters.id = StatusId_t.IncorrectNumParam; statusArray.incorrectNumParameters.message = "Incorrect number of parameters."; // Instantiate registered commands _registeredCmds = new System.Collections.ObjectModel.Collection <Command>(); _port = port; }
/// <summary> /// Base constructor. /// </summary> /// <param name="port"></param> /// <param name="debugPrint">The function to call to pass debug information to.</param> public Tx(Clide.Port port, Action <string> debugPrint) { Port = port; DebugPrint = debugPrint; }
/// <summary> /// Simplified constructor. DebugPrint left as null. /// </summary> /// <param name="port"></param> public Tx(Clide.Port port) { _port = port; }
/// <summary> /// Simplified constructor. Does not setup debug printing. /// </summary> public Controller() { Port = new Clide.Port(); Tx = new Clide.Tx(Port); Rx = new Clide.Rx(Port); }
/// <summary> /// Base constructor. /// </summary> /// <param name="debugPrint"></param> public Controller(Action <string> debugPrint) { Port = new Clide.Port(); Tx = new Clide.Tx(Port, debugPrint); Rx = new Clide.Rx(Port); }