by mimispa » Nov 9, 2006 @ 11:44am
Hi Edge,
Sory, but the problem still excist!
Now with Edge 2.9 the bluetooth device is connecting to server (Nokia N71) but the event OnNetMessage never fire.
It's very strange but, all seems to be ok, except that event OnNetMessage never fire, so i can't control and read the bluetooth devices.
It's better than 2.8 but still can't read the bluetooth device. I don't know why!
I'm posting sample of the code, if you can help me please!
void ClassMain::openserver()
{
myserver.flag_server_running=false;
if (ecd.net[0]->Init(ECONN_BLUETOOTH, this) == E_OK)
{
myserver.flag_server_running=ecd.net[0]->SearchHost(NULL, 4);//I try with other doors (not only 4) but nothing happens
}
//Now flag_server_running is true
}
void ClassMain::OnNetMessage(long id, long msg, long bufsize, unsigned char *buffer)
{
//****** Never comes here, so myserver.flag_onnet_message always false
myserver.flag_onnet_message=true;
switch (msg){
case ENET_RUNNINGSERVER: //The server is running, accept clients
break;
case ENET_ADDCLIENT: //A client has been added, accept and add this client or refuse if there are too many
if (id == 0 || id > MAX_CLIENTS)
{ecd.net[0]->Disconnect((unsigned char)id);}
else
{myserver.clientscount++;}
break;
case ENET_CLOSEDSOCKET: //The connection has been terminated
myserver.clientscount--;
break;
case ENET_RECEIVEDATA: //Data is received, add the data to a stack and interpret messages
break;
}
}
Thanks!