public static HealthDataResponse ToHealthDataResponse(byte[] data) { HealthDataResponse dataResponse = new HealthDataResponse(); dataResponse.Status = data[0]; dataResponse.ErrorCode = BitConverter.ToUInt16(data, 1); return(dataResponse); }
private void StartScan() { _rpLidar = new RPLidarSerialDevice("com6"); //Connect RPLidar _rpLidar.Connect(); //Reset - Not really sure how this is supposed to work, reconnecting USB works too //RPLidar.Reset(); //Stop motor _rpLidar.StopMotor(); //Get Device Information InfoDataResponse infoDataResponse = _rpLidar.GetInfo(); //Get Device Health HealthDataResponse healthDataResponse = _rpLidar.GetHealth(); //Get Data Event _rpLidar.NewScan += RPLidar_NewScan; //Start Scan Thread _rpLidar.StartScan(); }