Error 0x03EA sounds like you haven't paired the device you are connecting with, you need to go through this process before you can send and receive any data. Also note that before using SrmExtOpen to open your Bluetooth serial connection you must close the Bluetooth library otherwise you will get error 0x30A.

So after pairing the devices, Palm->mobile phone or Palm->modem or Palm->pc etc (once done you should not need to do this everytime), the process I go through to setup and use a Bluetooth serial connection is:

1) open the Bluetooth lib
2) setup a callback routine to deal with Bluetooth discovery responses (BtLibRegisterManagementNotification)
3) start the discovery process (BtLibStartInquiry)
4) find out if the device I want to connect to is in range and responding in my callback routine setup in step 2 5) once I have the device, fill in the Palm structures sppUid, btParams and SrmConfig
6) close the BtLib (**important**!)
7) open the serial connection using SrmExtOpen
8) send data to the paired device over the serial ink using SrmSend
8) use SrmReceiveWait to wait for incoming traffic and receive that data using SrmReceive
9) finally once I am done, use SrmClose to close the serial port

If you want I have a working example in Pascal which goes through the processes to connect to a Bluetooth modem.

Hope this helps!


Edward Jones



Shorin wrote:
Hi,

I'm relatively new to Palm OS Programming (but not programming in general). I can't seem to get the serial port open with the Bluetooth Connection panel serial port. The VirtRfComm doesn't work either, but I know that needs some extra settings passed to SrmOpenEx to open. I've been trying this with SrmOpen and SrmOpenBackground. Those functions keep failing with something like 0x03EA or something like that. This used to make my phone go into a reset loop until i deleted the program. I think i had other bad files that were causing that, though.

So anyways, whats the REAL way to open a bluetooth serial connection?

Thanks,

Shorin


--
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to