using System; using Microsoft.SPOT; namespace instrumentModel { class SeaBird41 : SerialDevice { public SeaBird41() : base("SBE41","COM2",19200,8,SerialParity.None,1) { // that's it! all of the serial port setup follows in the parent class. if (Status == DevStatus.Ready) { // We are configured, open and ready for commands. try { setup(); run(); } catch (Exception e) { //bark } } } public void setup() { //send startup commands read responses. } public void sendPTS() { write("PTS\r"); } public override DevStatus process(string msg) { return base.process(msg); } public override void run() { sendPTS(); // we've overridden this and now this will be our main loop. } } }