![](/images/new-backgrounds/1117894/11789423x1.webp)
Chapter 3 – Application Examples
Example 1 – Download Sales and Inventory from a Vending Machine
Adapter Setup Steps
This example uses a
1.Connect the PC to the
•9600 bps
•8 data bits
•no parity
•flow control enabled.
2.Configure the
•The default setting should be in slave mode.
•The baud rate should change to 115.2K bps. To change the baud rate, use the command:
ATSW20,472,0,0,1 <cr_lf>
3.Change the terminal program’s baud rate to 115.2K bps and verify that the PC can communicate with the Bluetooth adapter.
4.Make note of node ID for this unit by issuing the command: ATSI,1 <cr_lf> (“I” is the letter i). Knowing the node ID or local name of this unit will allow the master unit to select this unit when doing a search.
5.Set the class of device (COD) as 00520204 by issuing command: ATSC,00520204 <cr_lf>
Wireless-to-Bluetooth Modem Setup Steps
1.Connect the PC to the
Run a terminal program to configure the wireless modem as stated in Chapter 2.
2.Change the switch on the back of the chassis to
•115.2K bps
•8 data bits
•no parity
•1 stop bit
•flow control enabled.
3.Configure the Bluetooth to run as Master in data mode by issuing the command: ATSW25,1,1,0,0 <cr_lf>. It should reply with OK.
4.Clear the Bluetooth radio state by issuing command: ATUCL
5.Check that the Bluetooth is running as master by issuing command: ATSI,7 (“I” is i). This should reply with 1,1,0,0 if running as master in data mode.
6.Disconnect the cable from the
Note: The Bluetooth interface is not configured to reset and break the Bluetooth connection when the wireless modem drops the DTR and ends the connection. To configure it to use DTR for resetting the embedded Bluetooth, see the directions in Chapter 4.
Placing the
1.Relocate the Bluetooth adapter to the vending machine location and attach it to the vending machine.
2.Place the
3.Remotely connect to the wireless modem. At this point you will be talking with the Bluetooth device and any AT commands issued will be for the Bluetooth device.
4.Issue the command for the embedded master Bluetooth to search for the remote slave Bluetooth adapter: ATDI,1,00520204 (looks for one Bluetooth device with class of device = 00520204). If proper slave adapter is not found, increase the number of adapters to search for.
5.Connect to the slave Bluetooth device by issuing command: ATDM,slavenodeID,1101
6.Reply should display showing connection.
7.The wireless modem with Bluetooth is now connected to the vending machine.
12 |