5.2.2 Command State

During the Command state, the microcontroller acts as a USART bridge between the serial terminal and the RN4870 module.

Figure 5-2. Command State

This functionality opens a line of communication to the RN4870 module so that the PC can be used to retrieve the module MAC address. The Command state can also be entered to make any desired configurations, such as changing the name of the module.

The Command state is only for prototyping purposes, and will not be used in the final application.

Figure 5-3. Hercules Terminal
In Command state, use the following commands and:
  1. Check for the MAC address of the device. This info will be required later by the Lambda. The MAC address will be on the first line of the reply:
    • Send: ‘d
    • Reply: ‘BTA=D88039F37559
    • Reply: ‘Name=RN4870-7559
    • Reply: ‘Connected=no
    • Reply: ‘Authen=2
    • Reply: ‘Features=0000
    • Reply: ‘Services=C0
  2. Ensure the board uses the latest firmware available, which at this moment is v1.30:
    • Send: ‘v
    • Reply: ‘RN4870 V1.30 3/18/2018 (c)Microchip Technology Inc

In Command state, utilize any command described in the BLE RN4870 Module User's Guide.

Note: In this state, the application is no longer reading sensors and updating the characteristics.