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

Change ports on netduino 1

netduino1 port

  • Please log in to reply
1 reply to this topic

#1 holdonson

holdonson

    New Member

  • Members
  • Pip
  • 1 posts

Posted 27 April 2015 - 12:24 PM

Hi,

 

I have an issue.I am using netduino1, Quectel M10 and Quectel L10. When I try to change ports from GPS to GSM ans recieve some data a i got error "A first chance exception of type 'System.ArgumentException' occurred in Microsoft.SPOT.Hardware.SerialPort.dll".

 

Here is my code.

 serial2.DataReceived -= new SerialDataReceivedEventHandler(serial_DataReceived2);
            Thread.Sleep(4000);
            serial2.Close();
            Thread.Sleep(3000);
            serial.Open();
            Thread.Sleep(1000);
            
            serial.DataReceived += new SerialDataReceivedEventHandler(serial_DataReceived);
            Thread.Sleep(3000);
            settings = null;
            while (settings == null)
            {
                initializationPost();
            }
 
I suppose that problem is when I try to remove hadnler and than close the port, port is still recieving data and it throws an exception.
Could you please help me how to solve this?


#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 27 April 2015 - 06:58 PM

Hi holdonson,

Can you share a bit more of your code (or make a simple 10-line sample app which reproduces the issue) so we can help dig into it a bit more with you?

Chris




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.