RE: what to do with MAC address...
RE: what to do with MAC address...
- Subject: RE: what to do with MAC address...
- From: "Jon C. Munson II" <email@hidden>
- Date: Thu, 19 Feb 2009 13:50:24 -0500
- Organization: JTA Enterprises LLC
Beautiful!! Sweet!!
Thanks, that's exactly what I needed.
Peace, Love, and Light,
Jon C. Munson II
From: Volker in Lists [mailto:email@hidden]
Sent: Thursday, February 19, 2009 1:43 PM
To: email@hidden
Cc: email@hidden
Subject: Re: what to do with MAC address...
Hi there,
as a quick pointer - from one of my apps licensing code. Assuming that
MACAddress is the beasty UInt8 struct, the following should work:
NSString *addressString = [[NSString alloc]
initWithFormat:@"x:x:x:x:x:x",MACAddress[0],
MACAddress[1], MACAddress[2], MACAddress[3], MACAddress[4], MACAddress[5]];
Cheers,
Volker
Am 19.02.2009 um 19:26 schrieb Jon C. Munson II:
Namaste!
Per Apple's GetPrimaryMACAddress sample (found in Technical Note TN1103), I
can obtain a MAC address for a given Mac.
However, when I try to output that address to the screen, I get nothing.
So, my issue is, what do I do with the return value found inside that sample
so that it is output in the "standard" format of a MAC address?
The return value from IO Kit is a UInt8 struct which is filled with the
bytes of the MAC address.
I need to convert that to an NSString. Which I did using
stringWithUTF8Format - the raw conversion works fine. However, due to the
actual characters in the string, the return string isn't valid.
I'm guessing I need to do some further conversion prior to passing back the
actual string, but not sure what, nor how. It looks preliminarily to me
that I need to change the UInt8 byte array to an array that contains the hex
values of said bytes - is that correct? If so, how do I do that (as simple
as obtaining the character codes?)? I know that may be a noob question, but
I'm not usually delving into the lower levels of such stuff so I don't
remember - sorry!
Thanks!!!
Peace, Love, and Light,
/s/ Jon C. Munson II
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden