views:

59

answers:

0

Hi guys! I'm gonna try to introduce briefly what I'm working on, and then present my question... any help will be very much appreciated!

I've been trying to connect an Android device to other phones in order to import their phonebook info over bluetooth, using the phonebook access profile. To achieve that, I'm trying to place my device as PCE, while the other phone will act as the PSE.

I know that the PSE role is already implemented on Android, so I'm looking into its code and trying to somehow reverse engineer it to implement the other side.

So.. my problem is: when the server socket is created, it doesn't specify any UUID, it simply starts listening on a port 19, like this:

mServerSocket = mAdapter.listenUsingRfcommOn(PORT_NUM);

Wasn't it supposed to register the PBAP service somewhere? How does other devices discover the service, and more important, which UUID should I use when trying to connect in my PCE device with:

mSocket = mDevice.createRfcommSocketToServiceRecord(UUID_PBAP);

Thanks, Pedro.