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.

Crispin

Member Since 27 Aug 2010
Offline Last Active Jul 12 2021 10:29 AM
-----

Posts I've Made

In Topic: Two's compliment byte array to int16 - confusing results.

28 April 2014 - 09:35 PM

thanks folks!

 

CW2 - sorry, I should have said, it gives back 8 bytes which is 2 4-byte values. The second set of 4 bytes there is a second serial number.

 

So, your way works perfectly :D

I understand what you're doing but not why. I last did this stuff in school some 20 years ago and binary has changed so much since then ;) (TiC!)

I'll write it all down and understand it. Thanks for the help.

 

 

Lazy question - is there a lazy-man's wrapper in csharp which could have done this for me?

 

Cheers,

Crispin


In Topic: Two's compliment byte array to int16 - confusing results.

27 April 2014 - 10:40 PM

further confusion - 

 

Another property I have has a value of 60 (it's an int). So says the OEM application.

If I query the property I get 2 bytes coming back = 0x00, 0x3c (in int is 00, 60)

 

if I change it (with the OEM app) to 66 I get back  0x00, 0x42 (in int is 00, 66)

 

if I change it (with the OEM app) to 555 I get back  0x02, 0x2b (in int is 2, 43)

 

I'm lost - hoping someone can help?

 

I know this should be / is simple if you understand it all but I'm lost :(

 

Thanks

Crispin

 

Endianness... Windows / c# is little, the camera clearly states big. Doh. 

Well, that works now so sure I can understand the serial number now.... Maybe  :unsure:


In Topic: Two's compliment byte array to int16 - confusing results.

27 April 2014 - 10:18 PM

further confusion - 

 

Another property I have has a value of 60 (it's an int). So says the OEM application.

If I query the property I get 2 bytes coming back = 0x00, 0x3c (in int is 00, 60)

 

if I change it (with the OEM app) to 66 I get back  0x00, 0x42 (in int is 00, 66)

 

if I change it (with the OEM app) to 555 I get back  0x02, 0x2b (in int is 2, 43)

 

I'm lost - hoping someone can help?

 

I know this should be / is simple if you understand it all but I'm lost :(

 

Thanks

Crispin


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.