Negative number in memory

Related to the development libraries, released by Curt Binder
Post Reply
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Negative number in memory

Post by lnevo »

So, i am storing my latitude and longitude in memory and getting an error displaying it im the web page. looks like a closing > is not being sent...

Code: Select all

xena:~$ wget http://www.xxxxxxxx.com:2000/mi110
--2013-04-29 20:38:09--  http://www.xxxxxxxx.com:2000/mi110
Resolving www.xxxxxxxx.com... 98.113.xxx.xxx
Connecting to www.xxxxxxxx.com|98.113.xxx.xxx|:2000... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15 [text/xml]
Saving to: `mi110'

100%[======================================>] 15          --.-K/s   in 0s      

2013-04-29 20:38:10 (916 KB/s) - `mi110' saved [15/15]
This page contains the following errors:

error on line 1 at column 20: expected '>'
Below is a rendering of the page up to the first error.
xena:~$ cat mi110
<M110>-73</M110xena:~$
this is the error I get trying to display it..

Code: Select all

This page contains the following errors:

error on line 1 at column 20: expected '>'
Below is a rendering of the page up to the first error.
I should add that it's working fine. I have not tried to update it the value...
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Negative number in memory

Post by lnevo »

Ok tried updating it...it dropped the negative value. :( Looks like I found a bug for sure..
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Negative number in memory

Post by rimai »

I think it's because the controller doesn't have checks for uninitialized memory
Roberto.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Negative number in memory

Post by lnevo »

I did initialize it...from the ino i can read and write negative numbers fine...

It looks like the http logic is getting hung up on it..
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Negative number in memory

Post by rimai »

Ahhh... Sorry...
I should have read the post better.
You saved a negative number and you are trying to read....
The web server will break on neg numbers... You are correct.
The extra character "-" will make the xml string be short by 1 character, which is the > bracket of the last tag
Roberto.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Negative number in memory

Post by lnevo »

And writing it drops the negative..
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Negative number in memory

Post by lnevo »

Any ideas here or pointers. Do you think we can get around this? My only other option is to setup another set of variables to track whether it's a negative number or not.

Now that I can properly submit a git pull request... I don't mind working on this :)
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Negative number in memory

Post by rimai »

It's easy to fix the neg return data.
It will be more complicated to do the writing through the /mb or /mi command. I'll have to look at the code again. Curt was the one who implemented it.
Roberto.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Post by binder »

it can be more complicated doing the write, i guess i don't follow completely with what you are wanting to do. maybe I should read it more closely.
Post Reply