Hi, I'm testing a bluetooth application on HTC Diamond. I can send data but I can't receive data, the cellular that send data to the HTC (nokia 6131) show the messege: unable to connect (I disabled the option "Receive all incoming beams" in Setting, Connection of HTC).I'm try with DeviceListener example but don“t work.
Thanks.
Gustavo.
This is the code on HTC Diamond:
public override int connect()
{
//Inicia la escucha del servidor de bluetooth
mobjBltListener = new InTheHand.Net.ObexListener(InTheHand.Net.ObexTransport.Bluetooth);
mobjBltListener.Start();
System.Threading.Thread objHilo = new System.Threading.Thread(new System.Threading.ThreadStart(BltReceive));
objHilo.Start();
return 0;
}
private void BltReceive()
{
while (mobjBltListener.IsListening)
{
InTheHand.Net.ObexListenerContext objContext = mobjBltListener.GetContext();
InTheHand.Net.ObexListenerRequest objRequest = objContext.Request;
byte[ bytResult = new byte[objRequest.InputStream.Length];
int intRet;
intRet = objRequest.InputStream.Read(bytResult, 0, (int) objRequest.InputStream.Length);
if (intRet > 0)
{
_stream = bytResult;
_com.execute();
}
}
}