ardupilot/Tools/ArdupilotMegaPlanner/Comms/CommsFile.cs
Michael Oborne 25bcfdd1e7 Mission Planner 1.2.12
add arduino chip detect
fix apm2,2.5 dialog test
add write timeout. this will stop planner hangs on bad serial devices.
change quickview decimal places to 0.00
fix map clicking issue.
fix wind direction wrapping
add airspeed use
modify firmware screen from Marooned
major flightdata tab change.
add save/load polygon from file
add some error handling dialogs
2012-09-20 07:37:36 +08:00

57 lines
1.9 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO.Ports;
using System.IO;
namespace ArdupilotMega.Comms
{
public class CommsFile : ICommsSerial
{
// Methods
public void Close() { BaseStream.Close(); }
public void DiscardInBuffer() { }
//void DiscardOutBuffer();
public void Open()
{
BaseStream = File.OpenRead(PortName);
}
public int Read(byte[] buffer, int offset, int count)
{
return BaseStream.Read(buffer, offset, count);
}
//int Read(char[] buffer, int offset, int count);
public int ReadByte() { return BaseStream.ReadByte(); }
public int ReadChar() { return BaseStream.ReadByte(); }
public string ReadExisting() { return ""; }
public string ReadLine() { return ""; }
//string ReadTo(string value);
public void Write(string text) { }
public void Write(byte[] buffer, int offset, int count) { }
//void Write(char[] buffer, int offset, int count);
public void WriteLine(string text) { }
public void toggleDTR() { }
// Properties
public Stream BaseStream { get; private set; }
public int BaudRate { get; set; }
public int BytesToRead { get { return (int)(BaseStream.Length - BaseStream.Position); } }
public int BytesToWrite { get; set; }
public int DataBits { get; set; }
public bool DtrEnable { get; set; }
public bool IsOpen { get { return (BaseStream != null); } }
public Parity Parity { get; set; }
public string PortName { get; set; }
public int ReadBufferSize { get; set; }
public int ReadTimeout { get; set; }
public bool RtsEnable { get; set; }
public StopBits StopBits { get; set; }
public int WriteBufferSize { get; set; }
public int WriteTimeout { get; set; }
}
}