Netduino home hardware projects downloads community

Jump to content


Photo

N+ Serial.Write dropping the last byte

VB Serial N+

  • Please log in to reply
1 reply to this topic

#1 Woodlands-Glen

Woodlands-Glen

    Member

  • Members
  • PipPip
  • 16 posts

Posted 15 November 2013 - 09:32 PM

I have a very simple routine that gets the IP address of the Netduino Plus and prints it to the serial port.

 

LocalIP=Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces(0).IPAddress

buffer=System.Text.Encoding.UTF8.GetBytes(LocalIP)

Serial1.Write(buffer,0,buffer.length)

 

The IP address of the Netduino is 192.168.0.31.

 

The routine above sends 192.168.0.3 with a trailing space.

 

Running through the routine step by step shows that LocalIP is correct at 192.168.0.31, buffer is correct, is 12 characters long and ends in a decimal 49 (representing the 1) but the one is missing from the actual serial output.

 

Any ideas?

 

Glen



#2 Woodlands-Glen

Woodlands-Glen

    Member

  • Members
  • PipPip
  • 16 posts

Posted 15 November 2013 - 09:38 PM

One thing that I noticed... 

 

I get a warning: opcode 'conv.ovf.i4 will not throw exception.

 

This warning appears for every serial1.write command.

 

I also get a warning opcode 'add.ovf' overflow will not throw exception on for line that a Next resides on in a For Next loop.







Also tagged with one or more of these keywords: VB, Serial, N+

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.