5.2.11 Remote Command Mode Control (!,<0,1>[,<hex16>])

Format: !,<0,1>[,<hex16>]

Remote Command mode control is a special mode where the RNBD451 module allows the user to execute commands in a particular RNBD451 module from a connected peer device over a transparent UART connection. This feature allows control of an RNBD451 module without the use of a host microcontroller remotely either from another RNBD451 module or from a mobile application. This way, it provides a method to enable standalone implementation without the host MCU for the remote device.

A local device can use the Remote Command mode control to get access to the remote device (module) to access and control all its I/O ports. The command sent from the connected remote device will get executed and the result is sent back to the local device. All application logic is performed locally without the need for any programming or application logic to run on the remote device.

The user can achieve the Remote Command mode control functionality by making use of the transparent UART service. Therefore, it is necessary to enable the UART transparent service using the SS command before accessing the Remote Command mode control feature. There is an optional parameter to assign the connection handle in Remote Command mode under multiple links. This parameter is not needed for the Exiting mode. When RNBD451 performs Remote Command mode under multiple links as the client, it controls peer devices as servers one by one. That is, the client exits Remote Command mode before asking another peer device to enter Remote Command mode.

Command ! controls the remote command feature. It expects one parameter, either 1 or 0.

The input parameter 1 enables the Remote Command mode control and the device automatically enters Remote Command mode. The user can achieve the Remote Command mode control via transparent UART service. It is mandatory to provide the !,1 command while staying in Transparent UART mode. In Remote Command mode control, the command prompt CMD> changes to RMT>. The remote device side displays the RMT_CMD_ON.

If the link between two RNBD451 modules is not secured and bonded, issuing of the !,1 command is considered transparent UART data and is directly passed to the remote device through the data pipe.

Command ! is only effective under the following conditions:

  • Both local and remote devices support the UART transparent feature.
  • The two devices are already connected, secured and bonded.

Upon receiving the request to start the Remote Command session, the RNBD451 module accepts the request if the following conditions are met:

  • The Bluetooth Low Energy link between devices is secured and bonded.
  • The first 4 bytes of the local fixed PIN code (configured using SP command) match those of the peer device. For more details on the SP command, refer to 5.3.5.2 Set Fixed Pin Code (SP,<4/6 digit pin>). To strengthen the security, in RNBD451 v1.1 and later version, the command 5.3.5.12 Set Remote Command Mode Password (SPW,<text>) provides the means to set the password, the max length being 32 bytes. The 4-byte PIN code comparison is retained to maintain compatibility with older products if the password is null.

If the PIN code or password are not met, the Bluetooth Low Energy link disconnects immediately.

To exit from the remote command mode, issue the $$$ command. This will put the device into command mode, and the device will be ready to accept further commands. With the device in command mode, issue the !,0 command to disable the remote command mode. The remote device, then, exits Remote Command mode with a response of RMT_CMD_OFF at the remote device side.
Example:!,1// Enter Remote Command mode
!,0// Exit Remote Command mode
!,1,0071

// Ask the Bluetooth® Low Energy link which handle 0x0071 to enter Remote Command mode

Response:RMT>// Successfully enters Remote Command mode
%DISCONNECT%,<connHandle> / / At initiator side, if the fixed security pin is different in both devices
ERR_RMT_CMD<CR><LF> %DISCONNECT% // At Remote side, if the fixed security pin is different in both devices
AOK// Successfully exits Remote Command mode
Note: The command is not supported in multiple links.