On 03/03/2009, at 12:32 PM, Jay Kickliter wrote:
I have a case where I'm sending IEEE 754 32-bit floats to my Cocoa
program over a wireless serial link, they are being sent MSB first.
I'm using AMSerialPort to handle my data, and after a little
parsing, I'm left with a 4 byte NSData, which has the 32-bit float
split into 4 bytes.
I know I have to play around to make sure the bytes are in the right
order. But what I can't seem to figure out, is how I create a float
from those 4 bytes stored in an instance of NSData. Has anybody run
into this situation?_______________________________________________
Have a look at NSSwapBigFloatToHost and friends
--Graham
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to arch...@mail-archive.com