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

NETMF Framework API Discrepancies

.NETMF SecretLabs Framework API inconsistent

  • Please log in to reply
5 replies to this topic

#1 Dan Kowalczyk

Dan Kowalczyk

    Advanced Member

  • Members
  • PipPipPip
  • 44 posts
  • LocationSeattle

Posted 22 February 2013 - 09:55 PM

Hello everyone. I hope your projects are all coming along well. I'm noticing what I believe are discrepancies between the .NETMF API documented on MSDN and what I'm able to access in Visual Studio.

 

For example, I was searching through the Microsoft.SPOT.Hardware.Utilities namespace and found that there are methods specified for getting machine time ([font="'courier new', courier, monospace;"][color=rgb(0,0,0);]GetMachineTime()[/color][/font]) and setting local time ([font="'courier new', courier, monospace;"]SetLocalTime( Datetime dt)[/font]) . When I try to access these methods from my application, they are unrecognized.

 

Another example is that the entire [font="'courier new', courier, monospace;"]Ws[font="arial, helvetica, sans-serif;"] (web service) namespace is not available.[/font][/font]

 

Could someone explain these discrepancies?

 

(A side question: Can N+ support NETMF 4.2? I saw some people on the forum using cool new features like the [font="'courier new', courier, monospace;"]PWMChannels [font="arial, helvetica, sans-serif;"]enum and wonder if it's possible. Is there a good resource for getting the Diff of 4.1 and 4.2?)[/font][/font]

 


If you want a treat and don't mind the treatment...

#2 NooM

NooM

    Advanced Member

  • Members
  • PipPipPip
  • 490 posts
  • LocationAustria

Posted 22 February 2013 - 10:02 PM

what you are trying todo?

Utility.SetLocalTime(DateTime.Now); (example..) // working for me

 

the pwmchannels enum is a define from secretlabs, not microsoft. it just routes the pwmchannels to the right cpu.pwmchannel (thats from ms)

 

yes n+ supports 4.2.  4.2 is great!

 

for the webservice: sry no idea



#3 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 22 February 2013 - 10:20 PM

Hi Dan, Also...some of the classes are in add-on assemblies. Go to "Add References..." and check out the available NETMF assemblies. Some of the classes are in different assemblies than their desktop counterparts, to optimize for space. Chris

#4 Dan Kowalczyk

Dan Kowalczyk

    Advanced Member

  • Members
  • PipPipPip
  • 44 posts
  • LocationSeattle

Posted 22 February 2013 - 10:40 PM

Thank you both!

 

I was able to resolve this by adding a [font="'courier new', courier, monospace;"]Reference[/font]. I didn't know that the references (assemblies?) have a different naming scheme than the class names. This also clears up my confusion about why I couldn't find [font="'courier new', courier, monospace;"]System.Http[/font] in the APIs -- it's just a wrapper around the classes[font="'courier new', courier, monospace;"][font="arial, helvetica, sans-serif;"]. [/font][/font]

 

[font="'courier new', courier, monospace;"][font="arial, helvetica, sans-serif;"]I was also able to find the [font="'courier new', courier, monospace;"]Ws[font="arial, helvetica, sans-serif;"] namespace in the [font="'courier new', courier, monospace;"]MFWsStack [/font]assembly.[/font][/font][/font][/font]

 

Would it be correct to say that assemblies are a named collection of namespaces?

 

I'm downloading 4.2 now...


If you want a treat and don't mind the treatment...

#5 Dan Kowalczyk

Dan Kowalczyk

    Advanced Member

  • Members
  • PipPipPip
  • 44 posts
  • LocationSeattle

Posted 22 February 2013 - 11:04 PM

By the way, I should've looked at the very top of the forum for the answer to my 4.1 v. 4.2 question (D'oh).


If you want a treat and don't mind the treatment...

#6 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 22 February 2013 - 11:20 PM

Would it be correct to say that assemblies are a named collection of namespaces?

More specifically...assemblies are a collection of classes. These classes are generally in the namespace of the assembly--but that's more of a soft rule. In NETMF, the System.IO.Ports.SerialPort class is in Microsoft.SPOT.Hardware.SerialPort.dll, for instance. So you can usually find a class in the assembly of the same root namespace name. But sometimes they're separated out for space optimization reasons. Chris





Also tagged with one or more of these keywords: .NETMF, SecretLabs, Framework, API, inconsistent

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.