Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

SerialPort Application Help.

Serial port struct ArrayList

  • Please log in to reply
No replies to this topic

#1 technochris1

technochris1

    New Member

  • Members
  • Pip
  • 3 posts

Posted 15 October 2013 - 09:21 PM

Im Porting over an application that i made for the Arduino. The application should works as follows:

 

Steps:

  • Receive Serial Data. (Always ends in rn)
  • Parse out parts of the data
  • Check files on Sdcard for match. if no match stop here. 
  • Apply the Parsed Data to the initialization of an instance of a Struct.
  • Add the Struct to an ArrayList.
  • if the Structs existed for a certain amount of time, Signal the Serial port.
  • After a long period of time, remove the structs.

 

I Made a flowchart to explain the Application:

 

Posted Image

 

I have the Application working, but im experiencing Data Loss issues somewhere along the Line.

 

Here is my Actual Request Struct:

class Request{    public int Location_index { get; set; }    public char SubLocation { get; set; }    public int Details_index { get; set; }    public long Start_time { get; set; }    public int Level { get; set; }    public Request(int locIndex, char SubLoc, int Detail)    {        Location_index = locIndex;        SubLocation = SubLoc;        Details_index = Detail;        Start_time = DateTime.Now.Ticks;        Level = 0;    }    public override bool Equals(object obj)    {        Request ncs = obj as Request;        if (ncs == null) return false;        else        {            if (this.Location_index != ncs.Location_index) return false;            if (this.SubLocation != ncs.SubLocation) return false;            if (this.Details_index != ncs.Details_index) return false;            return true;        }    }}






Also tagged with one or more of these keywords: Serial port, struct, ArrayList

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.