public DataReceiver(string comPortName, DataPointReceivedCallback dataPointReceivedCallback1) { // Delegate for callback from SerialPortHelper class -- triggered when data is received from serial port if (dataReceivedCallBack == null) { dataReceivedCallBack = new SerialPortDataReceivedCallBack(dataReceived); } if (dataPointReceivedCallback == null) { dataPointReceivedCallback = dataPointReceivedCallback1; } // Instantiate a SerialPortHelper object if (serialPortHelper == null) { serialPortHelper = new SerialPortHelper(comPortName, dataReceivedCallBack); } // Testing DELETE LATER // sendSampleSpeedData(); }
public SerialPortHelper(string portName1, SerialPortDataReceivedCallBack dataReceivedCallBack1) { portName = portName1; dataReceivedCallBack = dataReceivedCallBack1; }