User Guide RN4870, RN4871 (Microchip) - 28

HerstellerMicrochip
BeschreibungBluetooth Low Energy Module
Seiten / Seite75 / 28 — RN4870/71 Bluetooth Low Energy Module User’s Guide. 2.6. ACTION COMMANDS. …
Dateiformat / GrößePDF / 1.1 Mb
DokumentenspracheEnglisch

RN4870/71 Bluetooth Low Energy Module User’s Guide. 2.6. ACTION COMMANDS. 2.6.1. +[,<text>]. Default:. Example:. Response:. 2.6.2

RN4870/71 Bluetooth Low Energy Module User’s Guide 2.6 ACTION COMMANDS 2.6.1 +[,<text>] Default: Example: Response: 2.6.2

Textversion des Dokuments

RN4870/71 Bluetooth Low Energy Module User’s Guide 2.6 ACTION COMMANDS
Action commands are used to invoke specific functions as well as display critical information.
2.6.1 +[,<text>]
Command + without a parameter toggles the local echo ON and OFF. If sending the + command in Command mode without a parameter, all typed characters are echoed to the output. Typing + again turns local echo off. If an input parameter is attached to the command +, the input parameter is directly echoed back to UART.
Default:
Off
Example:
+ // Turn local echo on
Response:
Echo ON Echo OFF <text>
2.6.2 $$$
This command causes the RN4870/71 to enter Command mode and display command prompt. The device passes characters as data and enters Command mode if it sees the $$$ sequence. If the Command Mode Guard bit is set using SR, the device sees any bytes before or after the $$$ characters in a one-second window, the device does not enter Command mode and these bytes are passed through. You can change the character string used to enter Command mode with the S$ command. The CMD> prompt is sent to UART to indicate that command session is started.
Example:
$$$ // Enter Command mode
Response:
CMD> // If command prompt is enabled CMD // If command prompt is disabled
2.6.3 ---
This command causes the device to exit Command mode, displaying END.
Example:
--- // Exit Command mode
Response:
END // End Command mode
2.6.4 !,<0,1>
RN4870/71 has the capability of Remote Command mode over UART Transparent connection. Remote Command mode uses UART Transparent service. Therefore, it is necessary to enable UART Transparent service using command SS before accessing Remote Command mode feature. The Remote Command mode feature enables the user to execute commands on a connected peer device. The command is sent to the connected remote device, exe- cuted at the remote device and the result is sent back to the local device. Since the UART output rate is usually far higher than the BLE transmission rate, if the output data (such as command H) exceeds the buffer size (128 octets), local device may only receive whatever is stored in the buffer. DS50002466C-page 28  2016-2018 Microchip Technology Inc. Document Outline Trademarks Table of Contents Preface Chapter 1. Overview 1.1 Introduction 1.2 Key Features 1.2.1 ASCII Command Interface 1.2.2 Transparent UART 1.2.3 Custom GATT Services 1.2.4 Embedded Scripting Feature 1.2.5 Remote Command Console 1.3 Command Mode and Data Mode Figure 1-1: Command Mode and Transparent UART (Data) mode 1.4 Accessing the RN4870/71 over UART Table 1-1: Default UART Settings 1.5 RN4870 PIO Control Lines Chapter 2. Command Reference 2.1 Introduction 2.2 Command Syntax 2.3 Set and Get Commands Table 2-1: Set and Get Commands Syntax Format 2.4 Set Commands 2.4.1 S-,<string> 2.4.2 S$,<char> 2.4.3 S%,<pre>,<post> 2.4.4 SA,<0-5 Table 2-2: Set I/O Capability 2.4.5 SB,<H8> Table 2-3: UART Baud Rate Settings 2.4.6 SC,<0-2> Table 2-4: CONNECTABLE AND NON-CONNECTABLE ADVERTIEMENT SETTINGS 2.4.7 SDA,<H16> 2.4.8 SDF,<text> 2.4.9 SDH,<text> 2.4.10 SDM,<text> 2.4.11 SDN,<text> 2.4.12 SDR,<text> 2.4.13 SDS,<text> 2.4.14 SF,1 2.4.15 SF,2 2.4.16 SGA,<0-5>/SGC,<0-5> Table 2-5: Typical Output Power values 2.4.17 SM,<1-3>,<hex16> 2.4.18 SN,<text> 2.4.19 SO,<0,1> 2.4.20 SP,<4/6 digit pin> 2.4.21 SR,<hex16> Table 2-6: Bitmap of Features 2.4.22 SS,<hex8> Table 2-7: Bitmap of Services 2.4.23 ST,<hex16>,<hex16>,<hex16>,<hex16> Table 2-8: Connection Parameters 2.4.24 STA,<hex16>,<hex16>,<hex16> 2.4.25 STB,<hex16> 2.4.26 SW,<hex8>,<hex8> Table 2-9: Pin Index and RN4870/71 Pins Table 2-10: Configurable Functions 2.5 Get Commands 2.5.1 GK 2.5.2 GNR 2.5.3 G<char> 2.6 Action Commands 2.6.1 +[,<text>] 2.6.2 $$$ 2.6.3 --- 2.6.4 !,<0,1> 2.6.5 @,<0-5> Table 2-11: analog Channels and Associated Pins 2.6.6 |I,<hex8> Table 2-12: Digital I/O Bitmap 2.6.7 |O,<hex8>,<hex8> 2.6.8 [,<1-2>,<0-3>,<hex16>,<hex16> Table 2-13: PWM Operation Selection Figure 2-1: Basic concept of PWM Operation 2.6.9 &,<MAC> 2.6.10 &C 2.6.11 &R 2.6.12 A[,<hex16>,<hex16>] 2.6.13 B 2.6.14 C 2.6.15 C,<0,1>,<address> 2.6.16 C<1-8> 2.6.17 D 2.6.18 F[,<hex16>,<hex16>] 2.6.19 I 2.6.20 IA,<hex8>,<Hex>/IB,<hex8>,<Hex>/IS,<hex8>,<Hex> NA,<hex8>,<Hex>/NB,<hex8>,<Hex>/NS,<hex8>,<Hex> Table 2-14: List of AD Types 2.6.21 JA,<0,1>,<MAC> 2.6.22 JB 2.6.23 JC 2.6.24 JD 2.6.25 K,1 2.6.26 M 2.6.27 O,0 2.6.28 R,1 2.6.29 T,<hex16>,<hex16>,<hex16>,<hex16> 2.6.30 U,<1-8,Z> 2.6.31 V 2.6.32 X 2.6.33 Y 2.6.34 Z 2.7 I2C Commands Table 2-15: I2C Peripheral Interface Table 2-16: I2C Commands 2.7.1 ]A Table 2-17: Clock values 2.7.2 ]Z 2.7.3 ]D 2.7.4 ]R 2.7.5 ]W 2.7.6 ]X 2.8 SPI Commands Table 2-18: SPI Peripheral Interface Table 2-19: SPI Contacts 2.8.1 {A Table 2-20: SPI Clock Polarity and Phase Settings Table 2-21: SPI Master Clock Rate Table 2-22: SPI Chip Select Pin 2.8.2 {Z 2.8.3 {X 2.8.4 }A Table 2-23: SPI Clock Polarity and Phase Settings Table 2-24: SPI Master Clock Rate 2.8.5 }Z 2.8.6 }R 2.8.7 }W 2.9 List Commands 2.9.1 LB 2.9.2 LC[,<P,UUID>] Figure 2-2: Listing Client Service and Characteristics 2.9.3 LS[,<P,UUID>] 2.9.4 LW 2.10 Service Configuration Commands 2.10.1 PC,<hex16/hex128>,<hex8>,<hex8> 2.10.2 PS,<hex16/hex128> 2.10.3 PZ 2.10.4 Defining Multiple Services 2.11 Characteristic Access Commands 2.11.1 Definition of Characteristic Access Commands Table 2-25: Format of GATT access commands 2.11.2 CHR 2.11.3 CHW 2.11.4 CI 2.11.5 SHR 2.11.6 SHW 2.12 Script Commands 2.12.1 WC 2.12.2 WP 2.12.3 WR[,<H6>] Table 2-26: Command WR Input Parameters and Associated Events 2.12.4 WW Chapter 3. Embedded Scripting Feature 3.1 Introduction 3.1.1 Script Overview 3.1.2 Event Driven Table 3-1: List of Events and Event Labels 3.1.3 Comments 3.1.4 Variables 3.1.5 Handle Association 3.1.6 Remote Function Call Chapter 4. Connection Examples 4.1 Connecting to RN4870 using SmartDiscover App Figure 4-1: Connect to the RN4870 module Figure 4-2: Service Discovery Figure 4-3: Characteristic Access 4.2 UART Transparent Connection Using SmartData Figure 4-4: Connect to RN4870 Figure 4-5: Data Exchange on SmartData APP Figure 4-6: Data Exchange on Terminal Emulator 4.3 Module-to-Module Connection Figure 4-7: Connecting two RN4870 modules Appendix A. Bluetooth Low Energy Fundamentals A.1 Introduction Table A-1: Characteristic Properties Figure A-1: GATT Service in RN4870 Appendix B. Transparent UART Service UUIDs B.1 Introduction Table B-1: Characteristic Properties Appendix C. Low-Power Operation C.1 Introduction Figure C-1: State Diagram Appendix D. Status Response Summary Quick Reference D.1 Introduction Table D-1: Status Messages Returned by RN4870 /71 Table D-2: Command Summary Quick Reference AMERICAS Corporate Office Atlanta Austin, TX Boston Chicago Dallas Detroit Houston, TX Indianapolis Los Angeles Raleigh, NC New York, NY San Jose, CA Canada - Toronto ASIA/PACIFIC Australia - Sydney China - Beijing China - Chengdu China - Chongqing China - Dongguan China - Guangzhou China - Hangzhou China - Hong Kong SAR China - Nanjing China - Qingdao China - Shanghai China - Shenyang China - Shenzhen China - Suzhou China - Wuhan China - Xian China - Xiamen China - Zhuhai ASIA/PACIFIC India - Bangalore India - New Delhi India - Pune Japan - Osaka Japan - Tokyo Korea - Daegu Korea - Seoul Malaysia - Kuala Lumpur Malaysia - Penang Philippines - Manila Singapore Taiwan - Hsin Chu Taiwan - Kaohsiung Taiwan - Taipei Thailand - Bangkok Vietnam - Ho Chi Minh EUROPE Austria - Wels Denmark - Copenhagen Finland - Espoo France - Paris Germany - Garching Germany - Haan Germany - Heilbronn Germany - Karlsruhe Germany - Munich Germany - Rosenheim Israel - Ra’anana Italy - Milan Italy - Padova Netherlands - Drunen Norway - Trondheim Poland - Warsaw Romania - Bucharest Spain - Madrid Sweden - Gothenberg Sweden - Stockholm UK - Wokingham Worldwide Sales and Service Worldwide Sales and Service