Matchingcallback in adhoc connection

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

Moderators: cheriff, TyRaNiD

Post Reply
charafe
Posts: 12
Joined: Tue Feb 06, 2007 7:32 pm

Matchingcallback in adhoc connection

Post by charafe »

Hi,

I am having trouble with the matchingcallback: it looks like it doesn't take any event into consideration. Here is my code (taken from PspPet)

Code: Select all

void matchingCallback(int unk1, int event, char *mac2, int optLen, char *optData)
{
	// This is called when there is an event, dont seem to be able to call
	// procs from here otherwise it causes a crash
	printf("in the matching callback");
	sceKernelDelayThread(5000*1000);
	if(event==MATCHING_JOINED)
	{
		AddPsp(mac2, optData, optLen);
	}
	else if(event==MATCHING_DISCONNECT)
	{
		DelPsp(mac2);
	}
	else
	{
		g_unk1 = unk1;
		g_matchEvent = event;
		g_matchOptLen = optLen;

		// Copy across the optional data
		strncpy(g_matchOptData, optData, optLen);

		// And the MAC address
		memcpy(g_mac, mac2, sizeof(char) * 6);

		matchChanged = 1;
	}
}



It is called in my prog like this

Code: Select all

matchingId = sceNetAdhocMatchingCreate( 3,
											0xA,
											0x22B,
											0x800,
											0x2DC6C0,
											0x5B8D80,
											3,
											0x7A120,
											matchingCallback);
Do you why it doesn't take any event into consideration?. [EDIT] I have notice that two of the prx i was loading encountered error: ifhandle.prx and pspnet.prx. Do you think it is linked?
Thank you, any information would be useful...
Rad
Post Reply