public void Test_CSerialPort_XTractInData() { try { SetupPort(); Stopwatch timer = new Stopwatch(); bool bDataRightFormat = false; timer.Start(); while (timer.Elapsed.TotalSeconds < 5) { Byte[] rec = hlPort.XtractInData(); if (rec != null && rec.Length > 0) { bDataRightFormat = true; break; } } Assert.IsTrue(bDataRightFormat); } finally { Clean(); } }
private void highLevelDataHandler() { Byte[] rawData = highLevelSerialPort.XtractInData(); IMessageHandler messageHandler = messageHandlerFactory.GetMessageHandler(CAccelerometerDataMessageHandler.MessageType); messageHandler.handleMessage(rawData); }