This section provides a description
of how to use the demo application to connect two configured board and communicate
over Bluetooth. Bluetooth PBAP is a simple Client-Server connection process. We will
setup one of the boards as a Server and the other board as a Client. We will then
initiate a connection from the Client to the Server. Once connected, we can transmit
data between the two devices over Bluetooth.
Server setup on the demo application
- We will setup the first board as
a Server. Perform the steps mentioned earlier in Running the Bluetooth
Code section to initialize the application. Once initialized, note the
Bluetooth address of the Server. We will later use this to initiate a connection
from the Client.
- On the Choose mode>
prompt, issue the Server command.
- You will see a list of all
possible commands at this time for a Server. You can see this list at any time
by entering Help at the Server> prompt.
- Now we are ready to open a
Server. To open a Server, at the Server> prompt, issue the Open
1. You can replace 1 with any number between 1 and 30, as long as there
is no Server open on that port. Once you see
PBAP_Register_Server_SDP_Record() success, you have a PBAP Server
open on port 1.
Client setup and device discovery on the demo application
- We will setup the second board as
a Client. Perform the steps mentioned earlier in "Running the Bluetooth Code"
section to initialize the application. On the Choose mode> prompt, enter
Client.
- You will see a list of all
possible commands at this time for a Client. You can see this list at any time
by issuing the Help at the Client> prompt.
- At the Client> prompt,
issue the Inquiry command. This will initiate the Inquiry process. Once
it is complete, you will get a list of all discovered devices.
- You can access this list any time
by issuing the DisplayInquiryList at the Client prompt.
Initiating connection from the Client
- Note the index number of the
first board that was configured as a Server. [If the list is not on the screen,
issue DisplayInquiryList command on the Client to display the list of
discovered devices again.]
- Issue a Open <index number>
<Server port number> command at the command prompt.
Note: Port 19 must be used when
connecting to Android phones and port 13 for IPhones.
- Wait for the PBAP Open
confirmation.
- When a Client successfully
connects to a Server, the Server will see the open indication.
Data Transfer between Client and Server
- Now we have a PBAP connection
established and both devices are ready to transmit data to each other.
- We can Set Directories and Pull
Phonebooks from Client by issuing the SetPhonebook <Path Change>
<Path Name> and PullPhonebook <Max List Count> <List
Start Offset> <Phonebook Path> commands.
- We can also get vCardListings and
individual vCard Entries by issuing the PullvCardList <Max List Count>
<List Start Offset> <Phonebook Path> and PullvCardEntry
<vCard Name>