This project is read-only.


Add BitConverter


Converting between byte[] and eg. float is a rather common action in embedded development.
This is also acknowledged by functions such as Microsoft.SPOT.Hardware.Utility.ExtractValueFromArray.
This just needs a few more overloads and be a bit more standardized (Eg. the .net BitConverter).
Closed Jul 16, 2014 at 7:57 PM by smaillet_ms
This was added in the 4.3.1 QFE


Illishar wrote Dec 9, 2010 at 10:13 AM

Woops, how do I change the type from "Issue" to "Feature"?

wrote Dec 9, 2010 at 1:20 PM

MikeIssa wrote Dec 9, 2010 at 9:28 PM

This is commonly requested. It is on NETMF's road map. See the Documentation page.
GHI added an overload to do float conversion in our library.
Personally, I like the Utility methods more than BitConverter for efficiency reasons. It is very common to convert numbers to byte arrays many times during an application runtime. BitConverter returns a new byte array every time whereas Utility methods can insert into an existing array.

GHI Electronics

Illishar wrote Dec 10, 2010 at 8:39 AM

I agree about the efficiency issue. But the ExtractValueFromArray etc. should at least be moved to the standard BitConverter class and namespace. (For consistency.) And you might also consider renaming the functions so they'll match the existing ones.

Illishar wrote Dec 10, 2010 at 9:11 AM

"It is on NETMF's road map. See the Documentation page."

I can't seem to find it anywhere on the road map. Do you have access to a better version that the one on codeplex?

I see you're assigned to the PWM/Analog issue though. Very nice! I were afraid that GHI would keep to themselves with all the wonderful things you've been creating. PWM is not your best shot though. How about redesigning your RLP to real P/Invokes and then contribute those? ;)

MikeIssa wrote Dec 10, 2010 at 7:21 PM

I see BitConverter at the bottom after the PWM by a couple of lines...


Illishar wrote Dec 13, 2010 at 8:09 AM

Hm, I only see "BitArray" in that area. (System.Collections.BitArray hasn't got anything to do with System.BitConverter. Furthermore I cannot understand why anyone would want to add the BitArray to tinyclr. It doesn't really add anything besides code spam.)

MikeIssa wrote Dec 14, 2010 at 4:40 PM

Oops, I read it wrong.

wrote Jan 9, 2011 at 12:05 AM

wrote Jan 18, 2011 at 5:55 PM

wrote Feb 24, 2011 at 9:14 PM

juliusfriedman wrote Mar 20, 2011 at 8:53 PM

@ Zach, Lorenzo, MSchwarts.

You guys are more then welcome to utilize my BitConverter, which expands upon the ByteReader, ByteWriter done my MSchwartz.


wrote Jun 12, 2011 at 4:48 AM

wrote Jun 14, 2011 at 11:16 AM

wrote Jun 28, 2011 at 1:54 AM

wrote Aug 1, 2011 at 9:56 PM

wrote Sep 7, 2011 at 4:24 PM

wrote Sep 11, 2011 at 5:19 PM

wrote Dec 2, 2011 at 4:33 AM

wrote Jan 24, 2012 at 9:15 PM

wrote Jan 26, 2012 at 10:14 AM

wrote Jan 29, 2012 at 9:45 PM

wrote Jul 2, 2012 at 4:04 PM

wrote Aug 5, 2012 at 3:20 AM

wrote Oct 11, 2012 at 9:37 PM

wrote Nov 4, 2012 at 6:47 AM

wrote Dec 26, 2012 at 11:23 AM

wrote Dec 27, 2012 at 11:07 PM

wrote Jan 30, 2013 at 9:30 AM

wrote Feb 12, 2013 at 4:19 PM

wrote Feb 14, 2013 at 6:58 AM

wrote Feb 22, 2013 at 1:46 AM

wrote Apr 22, 2013 at 5:15 AM

NicolasG wrote Jul 22, 2013 at 9:20 PM

If you want to compile your own solution, the full implementation is available here.

wrote Sep 27, 2013 at 8:50 PM

wrote Jan 19, 2014 at 5:17 AM

wrote Mar 10, 2014 at 7:10 PM

wrote Jul 16, 2014 at 7:57 PM