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

Using NETMF SerialPort in NET 4.5 Application

SerialPort NET 4.5

  • Please log in to reply
2 replies to this topic

#1 salvadorrichter

salvadorrichter

    New Member

  • Members
  • Pip
  • 7 posts
  • LocationSouth Germany

Posted 07 September 2014 - 07:47 PM

Hi,

 

I wrote a library in NETMF using the library in a Netduino application and in a .NET 4.5 Windows Desktop application.

It worked out fine for several cases until I added the Class SerialPort

The Definition in Microsoft.SPOT.Hardware.SerialPort.dll and in System.dll is incompatible.

VS Forces me to add Microsoft.SPOT.Hardware.SerialPort.dll to references when  I add my NETMF library, but then it complains for ambiguos Definition with System.dll.

 

Any way out this Dilemma?

I dont want to implement same function twice.

 

Regards

Salvador



#2 Spiked

Spiked

    Advanced Member

  • Members
  • PipPipPip
  • 129 posts

Posted 07 September 2014 - 08:04 PM

keep the serial port out of the common code or

surround it with #if MF_FRAMEWORK_VERSION_V4_3 #else

 

I thought serial port would be in System.IO?  

 

In any case, writing common code for a serial port between two different hosts may be pushing it, but I guess it could be done. I have mixed feelings on the utility of this. I would tend to write more robust code where resources are not constrained (error handling, longer messages, bigger buffers), but I have no idea as to your reasons to not want to do that.



#3 salvadorrichter

salvadorrichter

    New Member

  • Members
  • Pip
  • 7 posts
  • LocationSouth Germany

Posted 08 September 2014 - 07:23 PM

Yes, the SerialPort is in the package System.IO

I would like to use bidirectional communication between netduino and a Windows application, so I'd like to use the same code on both sides.

I think about isolating the Code for the SerialPOrt and implemet this part twice.







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.