■ Screenshot 4.
Giving the RN4020s
names is easy.
■ Screenshot 3. The
RN4020 BLE radios
have been reset to
factory defaults using
the command SF, 2.
that our simple command was executed.
I issued the D command to obtain the contents of the
We now have a central. So, let’s configure the
RN4020 attached to Tera Term Pro as the peripheral. As
Tera Term Pro and serial I/O monitor windows you see in
Screenshot 3. Both of the RN4020s have been rebooted
and reset to default factory settings. At this point, both
RN4020 PICtails have the WAKE LED illuminated. As
you’ve probably already figured out, we have a couple of
RN4020 PICtails and there is a BLE link in our future.
Note that both of our RN4020 PICtails are
unconnected/unbounded peripheral devices. To form a
BLE link, we will need to configure one of these RN4020s
as a central. Let’s make the radio attached to the CCS C
compiler serial I/O monitor the central; we’ll call it
“Central.” To make that name stick, we must issue the
command S-,Central. Let’s make the RN4020 attached to
Tera Term Pro the peripheral and call it “Peripheral.” Our
work is checked in Screenshot 4.
Now, let’s turn our attention to the central BLE radio
which really isn’t configured to be the central yet. Let’s
draw the king’s sword and knight the RN4020 attached to
the serial I/O monitor. In our case, the king’s sword is the
SR (Set Features) command. The argument of the SR
command is a 32-bit bit mask. Here’s the lowdown:
0x80000000 – Start the connection as a central
0x10000000 – Support MLDP
0x02000000 – Enable UART Flow Control
So, our command to create a central that supports
MLDP with UART flow control is SR,92000000. A reboot
(R,1) is required following the SR command. We can leave
the Server Services (command SS) alone for now as its
default argument of 0x80000000 is quite alright for us.
April 2015 61