This section provides a description of
how to use the demo application to connect two configured board and communicate over
Bluetooth. Bluetooth MAP 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, enter
Server.
- You will see a list of all
possible commands at this time for a Server. You can see this list at any time
by issuing the Help command at the Server> prompt.
- Now we are ready to open a
Server. To open a Server, at the Server>prompt, issue the OpenServer 1
C:\Temp command. You can replace 1 with any number between 1 and 30, as long as
there is no Server open on that port. The C:\Temp stands for the directory in
which you store your received messages. Once you see the
MAP_Open_Message_Access_Server() Successful notification, you have a MAP Server
open on port 1.
- 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 command 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 command 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.
- Wait for the Open Port confirmation.
- When a Client successfully
connects to a Server, the Server will see the open port indication.
- On the Client Side, open a
notification Server issuing both the OpenNotification 1 and
RequestNotification commands . We should see on the Server, a
Notification Registration Indication and a
MAP_Set_Notification_Registration_Response() Successful. On the Client
Side you should see a Notification Registration Confirmation Result.Data Transfer between Client and Server
- Now we have a MAP connection
established and both devices are ready to transmit data to each other. We can
set and get folders. For example you can issue the SetFolder 1 telecom
command.
- We can get a Message Listing and
an individual message. For example you can issue the GetMessageListing 65535
0 command.
- And we can set the message
status, push messages and update the inbox. For example, you can issue the
PushMessage 1 1 20000100004 0 1 command.