Getting local MAC Address

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Phantom8
Posts: 30
Joined: Fri Jun 17, 2005 10:17 am

Getting local MAC Address

Post by Phantom8 »

I'm trying to use the sceNetGetLocalEtherAddr() to get the local PSP MAC address. The API only works after the program has made a successful connection to a AP. The API fails if the program haven't made a successful connection to the AP and returns 0x80410180. Anyone know what the error code means? BTW, is there anyway to obtain the local MAC address without having physically made a connection to a AP. Thanks!
Vampire
Posts: 138
Joined: Tue Apr 12, 2005 8:16 am

Re: Getting local MAC Address

Post by Vampire »

Phantom8 wrote:BTW, is there anyway to obtain the local MAC address without having physically made a connection to a AP.
sceWlanGetEtherAddr
Phantom8
Posts: 30
Joined: Fri Jun 17, 2005 10:17 am

Post by Phantom8 »

Thanks for the reply, Vampire! The sceWlanGetEtherAddr api it's not included in the standard pspsdk library, which means I will need to load a .prx module and patch it my myself. The problem is I don't even know which prx contains this API and also not sure how to patch it. Any hints would be appreciated.
Vampire
Posts: 138
Joined: Tue Apr 12, 2005 8:16 am

Post by Vampire »

you don't have to load the sceWlan_driver (wlan.prx) because the kernel loads it by default...
Phantom8
Posts: 30
Joined: Fri Jun 17, 2005 10:17 am

Post by Phantom8 »

The standard pspsdk library does not contain this API. It gives me an error of "undefined reference to sceWlanGetEtherAddr" when I tried to compile/link my program. Any other suggestions? Thanks!
rinco
Posts: 255
Joined: Fri Jan 21, 2005 2:12 pm
Location: Canberra, Australia

Post by rinco »

so write the necessary .S and .h files and create (or just patch) a Makefile.am.
Phantom8
Posts: 30
Joined: Fri Jun 17, 2005 10:17 am

Post by Phantom8 »

I checked other .S files, but don't know how to get the entry point numbers and NIDs for WLAN module and its APIs. Can someone pls help?
PspPet
Posts: 210
Joined: Wed Mar 30, 2005 2:13 am
Contact:

Post by PspPet »

> I checked other .S files, but don't know how to get the entry point numbers and NIDs for WLAN module and its APIs.

Code: Select all

	STUB_START	"sceWlanDrv",0x40010000,0x00030004
	STUB_FUNC	0x93440b11,sceWlanDevIsPowerOn
	STUB_FUNC	0xd7763699,sceWlanGetSwitchState
	STUB_FUNC	0x0c622081,sceWlanGetEtherAddr
	STUB_END
or for the single entry

Code: Select all

	STUB_START	"sceWlanDrv",0x40010000,0x00010004
	STUB_FUNC	0x0c622081,sceWlanGetEtherAddr
	STUB_END
(notice the change for the count)

NOTE: you can get most names/nids from the database:
http://pspdev.ofcode.com/api.php?type=2&id=176
Phantom8
Posts: 30
Joined: Fri Jun 17, 2005 10:17 am

Post by Phantom8 »

The API works nicely now. Thanks everybody for your help. :)
yawza
Posts: 2
Joined: Sun Aug 07, 2005 2:16 pm

Post by yawza »

but is there anyway to obtain local MAC address without having to connect to a AP?
"As long as we have loyalty to the end, there is no point in believing in anything...even in those we love"
Warren
Posts: 175
Joined: Sat Jan 24, 2004 8:26 am
Location: San Diego, CA

Post by Warren »

I added wlan stuff to PSPSDK last ngiht, check out the example in samples/wlan.
yawza
Posts: 2
Joined: Sun Aug 07, 2005 2:16 pm

Post by yawza »

how do I get to samples/wlan?
"As long as we have loyalty to the end, there is no point in believing in anything...even in those we love"
Warren
Posts: 175
Joined: Sat Jan 24, 2004 8:26 am
Location: San Diego, CA

Post by Warren »

Update to the latest SDK version from SVN (svn://svn.pspdev.org/psp/trunk/pspsdk) you can also access that from http to browse it.

Samples get installed in /usr/local/pspdev/psp/sdk/samples
Post Reply