From: prn on
Hi,
I have develop my own server & client over bluetooth using normal
virtual com port for windows mobile 6.0 device .There is a
server already running one the device and client on other device,
Now,i need to transfer data from client to server.

step at server end as follow:

1: Register Device with
PORTEMUPortParams pp;
pp.channel = RFCOMM_CHANNEL_MULTIPLE;
pp.flocal = TRUE;
pp.uiportflags = 0;
2: after that,Open port using CreateFile.
3. used DeviceIoControl with IOCTL_BLUETOOTH_GET_RFCOMM_CHANNEL.
4.after that register service on server with particular GUID.
5.ConfigurePort with value
BaudRate=CBR_9600,
ByteSize = 8,,
fParity = true ,
Parity = , EVENPARITY ;
StopBits = ONESTOPBIT;
6.SetCommunicationTimeouts with value
ReadIntervalTimeout = MAXWORD,
ReadTotalTimeoutMultiplier =0,
ReadTotalTimeoutConstant=0,
WriteTotalTimeoutMultiplier=10,
WriteTotalTimeoutConstant =1000;

7:at create one thread for reading data..
ReadFile(hDevOpen,szBuffer, 999, &dwBytesRead, NULL);


Step at Client is follow:
1: Register Device with
PORTEMUPortParams pp;
pp.channel = 0;
pp.flocal = FALSE;
pp.device = btaddr;;
pp.uuidService = GUID;
pp.uiportflags = 0;
2: after that,Open port using CreateFile.
3. used DeviceIoControl with IOCTL_BLUETOOTH_GET_PEER_DEVICE.
4.ConfigurePort with value
BaudRate=CBR_9600,
ByteSize = 8,,
fParity = true ,
Parity = , EVENPARITY ;
StopBits = ONESTOPBIT;
5.SetCommunicationTimeouts with value
ReadIntervalTimeout = MAXWORD,
ReadTotalTimeoutMultiplier =0,
ReadTotalTimeoutConstant=0,
WriteTotalTimeoutMultiplier=10,
WriteTotalTimeoutConstant =1000;

7:at create one thread for writing data..
WriteFile(hDevOpen, &cBuffer, dwSize, &dwWritten, NULL);


Now the problem is that, i got succes for WriteFile at client with
dwSize & dwWritten is same.
But at Server end i got succes for ReadFile with any value means
dwBytesRead is equal to zero and no data in szBuffer.


What am i doing wrong?
Any help would be greatly appreciated..
Waiting for your replies..please help.