RN4870 Command Groups

A variety of universal asynchronous receiver/transmitter (UART) commands are used to control and configure the RN4870 module. All commands contain one, two or three case-insensitive characters and end with a carriage return ('\r', \x0d). The comma character is the delimiter for the commands and any argument. The list of commands available on the RN4870 can be classified into the following groups:

  • Action commands
  • Set/Get commands
  • List commands
  • Service definition
  • Characteristic access
  • Script control

Action Commands

These commands are used to start a process or a functionality or to display critical information.

Examples

  • The $ command makes the module enter Command mode
  • The A command starts the advertisement by the peripheral device
  • The F command starts the scan as central device
ActionCommands.png

Set/Get Commands

These commands are used to configure or read the configuration of the various functions of the module. The Set commands, which are used to configure, all begin with the letter S and need a reboot after each command for the command to take effect. The Get commands, which are used to read the current configuration, begin with the letter G.

Examples

  • Command SN sets a name for the device
  • Command SF, 1 resets the device to factory defaults
  • Command SS sets the default services to be supported by the RN4870 in GAP server role
  • Command GK gets the current connection status
SetAndGetCommands.png

List Commands

These commands list critical information in multiple lines. The information will end with the characters END.

Examples

  • Command LS lists the server services and their characteristics
  • Command LC lists the available client services and their characteristics
ListCommands.png

Service Configuration Commands

These commands are used to define services and their characteristics. All the definition will be stored in the Non-volatile memory (NVM) which can be restored after a power cycle.

Examples

  • Command PS sets the universally unique identifier (UUID) of the public or the private service
  • Command PC sets a private characteristic
ServiceCommands.png

Characteristic Access Commands

These commands are used to access and write the server/client characteristics. To address server services, the first letter of the command is S. To address client services, the first letter of the command is C.

Examples

  • Command SHR reads the content of the server service characteristic on the local device by addressing its handle
  • Command SHW writes the content of characteristic in server service to the local device by addressing its handle
  • Command CHR reads the content of the client service characteristic from the remote device by addressing its handle
  • Command CHW writes the content of the client service characteristic from the remote device by addressing its handle
CharacteristicAccessCommands.png

Scripting Commands

These commands are used for scripting process of the module.

Examples

  • Command WR starts execution of the script
  • Command WP stops script execution
  • Command WC clears the script, if any, loaded in the RN4870
ScriptCommands.png
© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.