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.

Joshk

Member Since 17 May 2012
Offline Last Active Apr 17 2019 03:14 AM
-----

Topics I've Started

Bit shift operator worked in 4.2 but not in 4.3

21 August 2016 - 06:27 PM

I was successfully using this code in the 4.2 framework to get the MAC address.  

    Private Function getMacAddress(ByVal seperator As String) As String
        Dim netIF As NetworkInterface() = NetworkInterface.GetAllNetworkInterfaces()
        Dim macAddress As String = ""
        ' Create a character array for hexidecimal conversion.'
        Const hexChars As String = "0123456789ABCDEF"
        ' Loop through the bytes.'
        For b As Integer = 0 To 5
            ' Grab the top 4 bits and append the hex equivalent to the return string.'
            macAddress += hexChars(netIF(0).PhysicalAddress(b) >> 4)
            ' Mask off the upper 4 bits to get the rest of it.'
            macAddress += hexChars(netIF(0).PhysicalAddress(b) And &HF)
            ' Add the dash only if the MAC address is not finished.'
            If b < 5 Then macAddress += seperator
        Next
        Return macAddress
    End Function

 

But after having to upgrade to 4.3 when I setup my new computer, the code-check underlines the code

netIF(0).PhysicalAddress(b) >> 4

and gives this error if I try to deploy:

Error 1 Type 'System.Nullable(Of )' is not defined.
 
If I remove the ">> 4" part of the line the code-check is happy.  So why is that operator not supported?  Do I need a special import now?

Bit shift operator worked in 4.2 but not in 4.3

21 August 2016 - 06:27 PM

Please delete this duplicate.


'Auto-Implemented Property' problem bug with 4.3

21 August 2016 - 06:03 PM

I need to deploy a program I have deployed dozens of times on 4.2 framework...  

I have a new computer now so I was forced to 4.3 because I couldn't find all the 4.2 drivers and downloads for my new computer.

 

So when I try to deploy I get this error:

Resolving.
Resolve: unknown type: System.Diagnostics.DebuggerBrowsableAttribute
Error: ff000000
Waiting for debug commands...
The program '[23] Micro Framework application: Managed' has exited with code 0 (0x0).

 

 

 
By creating an empty project and experimenting I discovered my Auto-Implemented Properties are causing it.  Have a look at one:
Public Class globalConfig
    Public Property version As Integer = 3
End Class

But it deploys if I write it like this:

Public Class globalConfig
    Public Property version As Integer
        Get
            Return _version
        End Get
        Set(value As Integer)
            _version = value
        End Set
    End Property
    Private _version As Integer = 3
End Class

This is a big deal because it now takes 9 lines of code to do what I used to use 1 for.  So my 50 lines of code will go to 450!  I don't know if the project will still fit on a Netduino Plus2 after all that work.

 

This appears to be a large bug in 4.3...  Am I missing something?


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.